turn magic into python
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 24 Feb 2006 22:31:00 +0000 (22:31 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 24 Feb 2006 22:31:00 +0000 (22:31 +0000)
lib/python/Components/Makefile.am
lib/python/Components/MovieList.py
lib/python/Components/MultiContent.py [new file with mode: 0644]
lib/python/Components/__init__.py

index 14eb23c..a41c210 100644 (file)
@@ -12,5 +12,7 @@ install_PYTHON = \
        EpgList.py ScrollLabel.py Timezones.py Language.py HelpMenuList.py \
        BlinkingPixmap.py Pixmap.py ConditionalWidget.py Slider.py LanguageList.py \
        PluginList.py PluginComponent.py RecordingConfig.py About.py UsageConfig.py \
-       FIFOList.py ServiceEventTracker.py Input.py TimerSanityCheck.py FileList.py
+       FIFOList.py ServiceEventTracker.py Input.py TimerSanityCheck.py FileList.py \
+       MultiContent.py
+
 
index 666067f..82d2c56 100644 (file)
@@ -2,6 +2,7 @@ from HTMLComponent import *
 from GUIComponent import *
 from Tools.FuzzyDate import FuzzyTime
 from ServiceReference import ServiceReference
+from Components.MultiContent import MultiContentEntryText, RT_HALIGN_LEFT, RT_HALIGN_RIGHT
 
 from enigma import eListboxPythonMultiContent, eListbox, gFont, iServiceInformation
 
@@ -9,18 +10,6 @@ from enigma import eServiceReference, eServiceCenter, \
        eServiceCenterPtr, iListableServicePtr, \
        iStaticServiceInformationPtr
 
-RT_HALIGN_LEFT = 0
-RT_HALIGN_RIGHT = 1
-RT_HALIGN_CENTER = 2
-RT_HALIGN_BLOCK = 4
-
-RT_VALIGN_TOP = 0
-RT_VALIGN_CENTER = 8
-RT_VALIGN_BOTTOM = 16
-
-RT_WRAP = 32
-
-
 #
 # | name of movie              |
 #
@@ -43,7 +32,7 @@ def MovieListEntry(serviceref, serviceHandler):
        begin = info.getInfo(serviceref, iServiceInformation.sTimeCreate)
        res = [ (serviceref, begin) ]
 
-       res.append((0, 0, 0, 560, 30, 0, RT_HALIGN_LEFT, info.getName(serviceref)))
+       res.append(MultiContentEntryText(pos=(0, 0), size=(560, 30), font = 0, flags = RT_HALIGN_LEFT, text = info.getName(serviceref)))
        
        description = info.getInfoString(serviceref, iServiceInformation.sDescription)
 
@@ -52,9 +41,9 @@ def MovieListEntry(serviceref, serviceHandler):
                t = FuzzyTime(begin)
                begin_string = t[0] + ", " + t[1]
        
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 30, 560, 20, 1, RT_HALIGN_LEFT, description))
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, 270, 20, 1, RT_HALIGN_LEFT, begin_string))
-       res.append((eListboxPythonMultiContent.TYPE_TEXT, 290, 50, 270, 20, 1, RT_HALIGN_RIGHT, len))
+       res.append(MultiContentEntryText(pos=(0, 30), size=(560, 20), font=1, flags=RT_HALIGN_LEFT, text=description))
+       res.append(MultiContentEntryText(pos=(0, 50), size=(270, 20), font=1, flags=RT_HALIGN_LEFT, text=begin_string))
+       res.append(MultiContentEntryText(pos=(290, 50), size=(270, 20), font=1, flags=RT_HALIGN_RIGHT, text=len))
        
        return res
 
diff --git a/lib/python/Components/MultiContent.py b/lib/python/Components/MultiContent.py
new file mode 100644 (file)
index 0000000..a728341
--- /dev/null
@@ -0,0 +1,15 @@
+RT_HALIGN_LEFT = 0
+RT_HALIGN_RIGHT = 1
+RT_HALIGN_CENTER = 2
+RT_HALIGN_BLOCK = 4
+
+RT_VALIGN_TOP = 0
+RT_VALIGN_CENTER = 8
+RT_VALIGN_BOTTOM = 16
+
+RT_WRAP = 32
+
+from enigma import eListboxPythonMultiContent
+
+def MultiContentEntryText(pos = (0, 0), size = (0, 0), font = 0, flags = 0, text = "", private = ()):
+       return (eListboxPythonMultiContent.TYPE_TEXT, pos[0], pos[1], size[0], size[1], font, flags, text) + private
index c006cba..1b148d7 100644 (file)
@@ -7,4 +7,4 @@ __all__ = ["ActionMap", "Button", "Clock", "ConfigList", "EventInfo",
        "InputDevice",  "ServicePosition", "IPAddress", "VariableIP", "IPGateway",
        "IPNameserver", "Network", "RFmon", "DiskInfo", "NimManager", "TimerEntry",
        "Lcd", "EpgList" "ScrollLabel", "Timezones", "HelpMenuList", "TimerSanityCheck",
-       "FileList" ]
+       "FileList", "MultiContent" ]