Permalink
Browse files

new converter: RefToPiconName to convert service reference to the for…

…mat expected by the renderer Picon
  • Loading branch information...
drecomx committed Jan 1, 2014
1 parent 1e54e06 commit e98335d8c51d53ef0ef3d73a4f4476ed9acbe507
View
@@ -89,6 +89,7 @@ SUBDIRS = \
pushservice \
quickbutton \
reconstructapsc \
+ reftopiconname \
remotetimer \
rsdownloader \
satloader \
View
@@ -516,6 +516,9 @@ reconstructapsc/meta/Makefile
reconstructapsc/src_cc/Makefile
reconstructapsc/src_py/Makefile
+reftopiconname/Makefile
+reftopiconname/src/Makefile
+
remotetimer/Makefile
remotetimer/meta/Makefile
remotetimer/src/Makefile
@@ -0,0 +1,2 @@
+Description: Converter to convert service reference to the format expected by the renderer Picon
+Depends: enigma2
@@ -0,0 +1 @@
+SUBDIRS = src
@@ -0,0 +1,4 @@
+installdir = $(libdir)/enigma2/python/Plugins/SkinComponents/RefToPiconName
+converterinstalldir = $(libdir)/enigma2/python/Components/Converter
+install_DATA = README
+converterinstall_PYTHON = RefToPiconName.py
View
@@ -0,0 +1,15 @@
+Description: Converter to convert the service reference to the format expected by the renderer Picon
+
+Usage example:
+
+<widget alphatest="blend" source="ServiceEvent" render="Picon" position="835,108" size="100,60" transparent="1" zPosition="5">
+ <convert type="RefToPiconName" />
+</widget>
+
+For bouquets and markers the name will be returned. For channels the service reference will be returned as a string.
+
+If you want to use this converter set a depends in the control file of your skin
+
+
+If you have any questions visit www.dreambox-tools.info
+dre
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+#
+# ServiceReference to PiconName - Converter
+#
+# Coded by dre (c) 2014
+# Support: www.dreambox-tools.info
+# E-Mail: dre@dreambox-tools.info
+#
+# This plugin is open source but it is NOT free software.
+#
+# This plugin may only be distributed to and executed on hardware which
+# is licensed by Dream Multimedia GmbH.
+# In other words:
+# It's NOT allowed to distribute any parts of this plugin or its source code in ANY way
+# to hardware which is NOT licensed by Dream Multimedia GmbH.
+# It's NOT allowed to execute this plugin and its source code or even parts of it in ANY way
+# on hardware which is NOT licensed by Dream Multimedia GmbH.
+#
+# If you want to use or modify the code or parts of it,
+# you have to keep MY license and inform me about the modifications by mail.
+#
+
+from Components.Converter.Converter import Converter
+from Components.Element import cached
+from enigma import eServiceCenter, eServiceReference
+
+class RefToPiconName(Converter, object):
+ def __init__(self, type):
+ Converter.__init__(self, type)
+
+ @cached
+ def getText(self):
+ ref = self.source.service
+ if ref is not None:
+ #bouquet or marker
+ if ref.flags & (eServiceReference.isDirectory|eServiceReference.isMarker):
+ info = eServiceCenter.getInstance().info(ref)
+ if info:
+ return info.getName(ref).replace(" ","_")
+ #channel
+ else:
+ return ref.toString()
+
+ return ""
+
+ text = property(getText)

0 comments on commit e98335d

Please sign in to comment.