aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Screens/SubservicesQuickzap.py
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-02-24 20:56:21 +0100
committerghost <andreas.monzner@multimedia-labs.de>2009-02-24 20:56:21 +0100
commit574f425cc1ebece0aa5f09fb77a8cb7ad0310a1f (patch)
treee2ded87bb0e66cd9e88ae8d4ffc3846f788343bf /lib/python/Screens/SubservicesQuickzap.py
parent5a6bde9419249a78c957093e0cc438d7c6eeb46c (diff)
downloadenigma2-574f425cc1ebece0aa5f09fb77a8cb7ad0310a1f.tar.gz
enigma2-574f425cc1ebece0aa5f09fb77a8cb7ad0310a1f.zip
small optimizations and cleanups by Moritz Venn
Diffstat (limited to 'lib/python/Screens/SubservicesQuickzap.py')
-rw-r--r--lib/python/Screens/SubservicesQuickzap.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/python/Screens/SubservicesQuickzap.py b/lib/python/Screens/SubservicesQuickzap.py
index 24af517d..3bcc3c46 100644
--- a/lib/python/Screens/SubservicesQuickzap.py
+++ b/lib/python/Screens/SubservicesQuickzap.py
@@ -9,10 +9,17 @@ from Components.ServiceEventTracker import InfoBarBase
from enigma import eTimer
-class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, InfoBarAudioSelection, Screen):
+class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, \
+ InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, \
+ InfoBarTimeshiftState, InfoBarExtensions, InfoBarSubtitleSupport, \
+ InfoBarAudioSelection, Screen):
+
def __init__(self, session, subservices):
Screen.__init__(self, session)
- for x in [InfoBarBase, InfoBarShowHide, InfoBarMenu, InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, InfoBarTimeshiftState, InfoBarSubtitleSupport, InfoBarExtensions, InfoBarAudioSelection]:
+ for x in InfoBarBase, InfoBarShowHide, InfoBarMenu, \
+ InfoBarInstantRecord, InfoBarSeek, InfoBarTimeshift, \
+ InfoBarTimeshiftState, InfoBarSubtitleSupport, \
+ InfoBarExtensions, InfoBarAudioSelection:
x.__init__(self)
self.restoreService = self.session.nav.getCurrentlyPlayingServiceReference()
@@ -97,12 +104,15 @@ class SubservicesQuickzap(InfoBarBase, InfoBarShowHide, InfoBarMenu, InfoBarInst
def showSelection(self):
self.updateSubservices()
tlist = []
- if self.n is not None:
- for x in range(self.n):
- i = self.subservices.getSubservice(x)
- tlist.append((i.getName(), x))
+ n = self.n or 0
+ if n:
+ idx = 0
+ while idx < n:
+ i = self.subservices.getSubservice(idx)
+ tlist.append((i.getName(), idx))
+ idx += 1
- keys = [ "", "1", "2", "3", "4", "5", "6", "7", "8", "9" ] + [""] * self.n
+ keys = [ "", "1", "2", "3", "4", "5", "6", "7", "8", "9" ] + [""] * n
self.session.openWithCallback(self.subserviceSelected, ChoiceBox, title=_("Please select a subservice..."), list = tlist, selection = self.currentlyPlayingSubservice, keys = keys)
def subserviceSelected(self, service):