</widget>
<!-- Channellogo (Picon) -->
<widget source="CurrentService" render="Picon" position="47,2" zPosition="2" size="74,57" >
- <convert type="ServiceName">Name</convert>
+ <convert type="ServiceName">Reference</convert>
</widget>
<!-- Service name -->
<widget source="CurrentService" render="Label" position="130,30" size="360,27" font="Regular;21" valign="center" halign="right" noWrap="1" backgroundColor="#263c59" shadowColor="#1d354c" shadowOffset="-1,-1" transparent="1" >
pngname = ""
if what[0] != self.CHANGED_CLEAR:
sname = self.source.text
+ # strip all after last :
+ pos = sname.rfind(':')
+ if pos != -1:
+ sname = sname[:pos].rstrip(':')
pngname = self.nameCache.get(sname, "")
if pngname == "":
pngname = self.findPicon(self.source.text)
- if pngname == "":
- self.nameCache[sname] = pngname
- else:
+ if pngname != "":
self.nameCache[sname] = pngname
if pngname == "": # no picon for service found
pngname = self.nameCache.get("default", "")
def findPicon(self, serviceName):
for path in self.searchPaths:
- if pathExists(path):
- png = self.findFile(path, serviceName)
- if png != "":
- return png
+ pngname = path + serviceName + ".png"
+ if fileExists(pngname):
+ return pngname
return ""
-
- def findFile(self, path, serviceName):
- pngname = path + serviceName + ".png"
- if fileExists(pngname):
- return pngname
- else:
- for i in range(len(serviceName), 1, -1):
- if fileExists(path + serviceName[0:i] + ".png"):
- return path + serviceName[0:i] + ".png"
- return ""