Videomode: Add class name in print messages to aid when debugging
authorAthanasios Oikonomou <athoik@gmail.com>
Mon, 14 Dec 2015 20:04:29 +0000 (22:04 +0200)
committerErik Slagter <erik@openpli.org>
Tue, 15 Dec 2015 15:00:37 +0000 (16:00 +0100)
(cherry picked from commit f43fd862f82cd9302e91d272c7386340eaed6be4)
Signed-off-by: Erik Slagter <erik@openpli.org>

lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py

index 7f39456..81886eb 100644 (file)
@@ -67,7 +67,7 @@ class VideoHardware:
                ret = (16,9)
                port = config.av.videoport.value
                if port not in config.av.videomode:
-                       print "current port not available in getOutputAspect!!! force 16:9"
+                       print "[VideoHardware] current port not available in getOutputAspect!!! force 16:9"
                else:
                        mode = config.av.videomode[port].value
                        force_widescreen = self.isWidescreenMode(port, mode)
@@ -100,7 +100,7 @@ class VideoHardware:
                self.readAvailableModes()
 
                if self.modes.has_key("DVI-PC") and not self.getModeList("DVI-PC"):
-                       print "remove DVI-PC because of not existing modes"
+                       print "[VideoHardware] remove DVI-PC because of not existing modes"
                        del self.modes["DVI-PC"]
 
                self.createConfig()
@@ -134,7 +134,7 @@ class VideoHardware:
                try:
                        modes = open("/proc/stb/video/videomode_choices").read()[:-1]
                except IOError:
-                       print "couldn't read available videomodes."
+                       print "[VideoHardware] couldn't read available videomodes."
                        self.modes_available = [ ]
                        return
                self.modes_available = modes.split(' ')
@@ -144,12 +144,12 @@ class VideoHardware:
                        modes = open("/proc/stb/video/videomode_preferred").read()[:-1]
                        self.modes_preferred = modes.split(' ')
                except IOError:
-                       print "reading preferred modes failed, using all modes"
+                       print "[VideoHardware] reading preferred modes failed, using all modes"
                        self.modes_preferred = self.modes_available
 
                if self.modes_preferred != self.last_modes_preferred:
                        self.last_modes_preferred = self.modes_preferred
-                       print "hotplug on dvi"
+                       print "[VideoHardware] hotplug on dvi"
                        self.on_hotplug("DVI") # must be DVI
 
        # check if a high-level mode with a given rate is available.
@@ -164,7 +164,7 @@ class VideoHardware:
                return mode in self.widescreen_modes
 
        def setMode(self, port, mode, rate, force = None):
-               print "setMode - port:", port, "mode:", mode, "rate:", rate
+               print "[VideoHardware] setMode - port:", port, "mode:", mode, "rate:", rate
                # we can ignore "port"
                self.current_mode = mode
                self.current_port = port
@@ -185,17 +185,17 @@ class VideoHardware:
                                # fallback if no possibility to setup 50/60 hz mode
                                open("/proc/stb/video/videomode", "w").write(mode_50)
                        except IOError:
-                               print "setting videomode failed."
+                               print "[VideoHardware] setting videomode failed."
 
                try:
                        open("/etc/videomode", "w").write(mode_50) # use 50Hz mode (if available) for booting
                except IOError:
-                       print "writing initial videomode to /etc/videomode failed."
+                       print "[VideoHardware] writing initial videomode to /etc/videomode failed."
 
                self.updateAspect(None)
 
        def saveMode(self, port, mode, rate):
-               print "saveMode", port, mode, rate
+               print "[VideoHardware] saveMode", port, mode, rate
                config.av.videoport.value = port
                config.av.videoport.save()
                if port in config.av.videomode:
@@ -221,7 +221,7 @@ class VideoHardware:
 
        # get a list with all modes, with all rates, for a given port.
        def getModeList(self, port):
-               print "getModeList for port", port
+               print "[VideoHardware] getModeList for port", port
                res = [ ]
                for mode in self.modes[port]:
                        # list all rates which are completely valid
@@ -260,13 +260,13 @@ class VideoHardware:
        def setConfiguredMode(self):
                port = config.av.videoport.value
                if port not in config.av.videomode:
-                       print "current port not available, not setting videomode"
+                       print "[VideoHardware] current port not available, not setting videomode"
                        return
 
                mode = config.av.videomode[port].value
 
                if mode not in config.av.videorate:
-                       print "current mode not available, not setting videomode"
+                       print "[VideoHardware] current mode not available, not setting videomode"
                        return
 
                rate = config.av.videorate[mode].value
@@ -295,7 +295,7 @@ class VideoHardware:
 
                port = config.av.videoport.value
                if port not in config.av.videomode:
-                       print "current port not available, not setting videomode"
+                       print "[VideoHardware] current port not available, not setting videomode"
                        return
                mode = config.av.videomode[port].value
 
@@ -326,7 +326,7 @@ class VideoHardware:
                else:
                        wss = "auto"
 
-               print "-> setting aspect, policy, policy2, wss", aspect, policy, policy2, wss
+               print "[VideoHardware] -> setting aspect, policy, policy2, wss", aspect, policy, policy2, wss
                open("/proc/stb/video/aspect", "w").write(aspect)
                open("/proc/stb/video/policy", "w").write(policy)
                open("/proc/stb/denc/0/wss", "w").write(wss)
index c04f34d..3774454 100644 (file)
@@ -61,7 +61,7 @@ class VideoWizard(WizardLanguage, Rc):
 
 
        def createSummary(self):
-               print "++++++++++++***++**** VideoWizard-createSummary"
+               print "[VideoWizard] createSummary"
                from Screens.Wizard import WizardSummary
                return VideoWizardSummary
 
@@ -84,18 +84,18 @@ class VideoWizard(WizardLanguage, Rc):
                                if port != "DVI-PC":
                                        list.append((descr,port))
                list.sort(key = lambda x: x[0])
-               print "listInputChannels:", list
+               print "[VideoWizard] listInputChannels:", list
                return list
 
        def inputSelectionMade(self, index):
-               print "inputSelectionMade:", index
+               print "[VideoWizard] inputSelectionMade:", index
                self.port = index
                self.inputSelect(index)
 
        def inputSelectionMoved(self):
                hw_type = HardwareInfo().get_device_name()
                has_hdmi = HardwareInfo().has_hdmi()
-               print "input selection moved:", self.selection
+               print "[VideoWizard] input selection moved:", self.selection
                self.inputSelect(self.selection)
                if self["portpic"].instance is not None:
                        picname = self.selection
@@ -104,9 +104,9 @@ class VideoWizard(WizardLanguage, Rc):
                        self["portpic"].instance.setPixmapFromFile(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/" + picname + ".png"))
 
        def inputSelect(self, port):
-               print "inputSelect:", port
+               print "[VideoWizard] inputSelect:", port
                modeList = self.hw.getModeList(self.selection)
-               print "modeList:", modeList
+               print "[VideoWizard] modeList:", modeList
                self.port = port
                if (len(modeList) > 0):
                        ratesList = self.listRates(modeList[0][0])
@@ -114,25 +114,25 @@ class VideoWizard(WizardLanguage, Rc):
 
        def listModes(self):
                list = []
-               print "modes for port", self.port
+               print "[VideoWizard] modes for port", self.port
                for mode in self.hw.getModeList(self.port):
                        #if mode[0] != "PC":
                                list.append((mode[0], mode[0]))
-               print "modeslist:", list
+               print "[VideoWizard] modeslist:", list
                return list
 
        def modeSelectionMade(self, index):
-               print "modeSelectionMade:", index
+               print "[VideoWizard] modeSelectionMade:", index
                self.mode = index
                self.modeSelect(index)
 
        def modeSelectionMoved(self):
-               print "mode selection moved:", self.selection
+               print "[VideoWizard] mode selection moved:", self.selection
                self.modeSelect(self.selection)
 
        def modeSelect(self, mode):
                ratesList = self.listRates(mode)
-               print "ratesList:", ratesList
+               print "[VideoWizard] ratesList:", ratesList
                if self.port == "DVI" and mode in ("720p", "1080i", "1080p"):
                        self.rate = "multi"
                        self.hw.setMode(port = self.port, mode = mode, rate = "multi")
@@ -143,13 +143,13 @@ class VideoWizard(WizardLanguage, Rc):
                if querymode is None:
                        querymode = self.mode
                list = []
-               print "modes for port", self.port, "and mode", querymode
+               print "[VideoWizard] modes for port", self.port, "and mode", querymode
                for mode in self.hw.getModeList(self.port):
-                       print mode
+                       print "[VideoWizard] mode:", mode
                        if mode[0] == querymode:
                                for rate in mode[1]:
                                        if self.port == "DVI-PC":
-                                               print "rate:", rate
+                                               print "[VideoWizard] rate:", rate
                                                if rate == "640x480":
                                                        list.insert(0, (rate, rate))
                                                        continue
@@ -157,12 +157,12 @@ class VideoWizard(WizardLanguage, Rc):
                return list
 
        def rateSelectionMade(self, index):
-               print "rateSelectionMade:", index
+               print "[VideoWizard] rateSelectionMade:", index
                self.rate = index
                self.rateSelect(index)
 
        def rateSelectionMoved(self):
-               print "rate selection moved:", self.selection
+               print "[VideoWizard] rate selection moved:", self.selection
                self.rateSelect(self.selection)
 
        def rateSelect(self, rate):
@@ -171,7 +171,7 @@ class VideoWizard(WizardLanguage, Rc):
        def showTestCard(self, selection = None):
                if selection is None:
                        selection = self.selection
-               print "set config.misc.showtestcard to", {'yes': True, 'no': False}[selection]
+               print "[VideoWizard] set config.misc.showtestcard to", {'yes': True, 'no': False}[selection]
                if selection == "yes":
                        config.misc.showtestcard.value = True
                else: