From 574f425cc1ebece0aa5f09fb77a8cb7ad0310a1f Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 24 Feb 2009 20:56:21 +0100 Subject: small optimizations and cleanups by Moritz Venn --- lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py | 4 ++-- lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py | 2 +- lib/python/Plugins/SystemPlugins/Videomode/plugin.py | 13 ++++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'lib/python/Plugins/SystemPlugins/Videomode') diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py index 6a85c4da..64f79e04 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py @@ -67,7 +67,7 @@ class VideoHardware: else: mode = config.av.videomode[port].value force_widescreen = self.isWidescreenMode(port, mode) - is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"] + is_widescreen = force_widescreen or config.av.aspect.value in ("16_9", "16_10") is_auto = config.av.aspect.value == "auto" if is_widescreen: if force_widescreen: @@ -283,7 +283,7 @@ class VideoHardware: force_widescreen = self.isWidescreenMode(port, mode) - is_widescreen = force_widescreen or config.av.aspect.value in ["16_9", "16_10"] + is_widescreen = force_widescreen or config.av.aspect.value in ("16_9", "16_10") is_auto = config.av.aspect.value == "auto" policy2 = "policy" # use main policy diff --git a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py index 095e94c0..8f8bea09 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py @@ -165,7 +165,7 @@ class VideoWizard(WizardLanguage, Rc): config.misc.showtestcard.value = False def keyNumberGlobal(self, number): - if number in [1,2,3]: + if number in (1,2,3): if number == 1: self.hw.saveMode("DVI", "720p", "multi") elif number == 2: diff --git a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py index 30bdf796..5a7dfd1b 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py @@ -52,8 +52,9 @@ class VideoSetup(Screen, ConfigListScreen): def createSetup(self): level = config.usage.setup_level.index - self.list = [ ] - self.list.append(getConfigListEntry(_("Video Output"), config.av.videoport)) + self.list = [ + getConfigListEntry(_("Video Output"), config.av.videoport) + ] # if we have modes for this port: if config.av.videoport.value in config.av.videomode: @@ -76,9 +77,11 @@ class VideoSetup(Screen, ConfigListScreen): if not force_wide: self.list.append(getConfigListEntry(_("Aspect Ratio"), config.av.aspect)) - if force_wide or config.av.aspect.value in ["16_9", "16_10"]: - self.list.append(getConfigListEntry(_("Display 4:3 content as"), config.av.policy_43)) - self.list.append(getConfigListEntry(_("Display >16:9 content as"), config.av.policy_169)) + if force_wide or config.av.aspect.value in ("16_9", "16_10"): + self.list.extend(( + getConfigListEntry(_("Display 4:3 content as"), config.av.policy_43), + getConfigListEntry(_("Display >16:9 content as"), config.av.policy_169) + )) elif config.av.aspect.value == "4_3": self.list.append(getConfigListEntry(_("Display 16:9 content as"), config.av.policy_169)) -- cgit v1.2.3