def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer=None): EPGList.__init__(self, type, selChangedCB, timer) self.l.setBuildFunc(self.buildEPGSearchEntry) self.piconLoader = PiconLoader() sizes = componentSizes[EPGList.SKIN_COMPONENT_KEY] self._iconWidth = sizes.get(EPGList.SKIN_COMPONENT_ICON_WIDTH, 21) self._iconHeight = sizes.get(EPGList.SKIN_COMPONENT_ICON_HEIGHT, 21) self._iconHPos = sizes.get(EPGList.SKIN_COMPONENT_ICON_HPOS, 4) self._itemMargin = sizes.get(EPGList.SKIN_COMPONENT_ITEM_MARGIN, 10) servicelist_sizes = componentSizes["ServiceList"] self._picon_width = servicelist_sizes.get(ServiceList.KEY_PICON_WIDTH, 58) if PartnerBoxIconsEnabled: # Partnerbox Clock Icons self.remote_clock_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock.png' ) self.remote_clock_add_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_add.png' ) self.remote_clock_pre_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_pre.png' ) self.remote_clock_post_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_post.png' ) self.remote_clock_prepost_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_prepost.png' )
def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer=None): EPGList.__init__(self, type, selChangedCB, timer) self.l.setBuildFunc(self.buildEPGSearchEntry) self.piconLoader = PiconLoader() sizes = componentSizes[EPGList.SKIN_COMPONENT_KEY] self._iconWidth = sizes.get(EPGList.SKIN_COMPONENT_ICON_WIDTH, 21) self._iconHeight = sizes.get(EPGList.SKIN_COMPONENT_ICON_HEIGHT, 21) self._iconHPos = sizes.get(EPGList.SKIN_COMPONENT_ICON_HPOS, 4) self._itemMargin = sizes.get(EPGList.SKIN_COMPONENT_ITEM_MARGIN, 10) servicelist_sizes = componentSizes["ServiceList"] self._picon_width = servicelist_sizes.get(ServiceList.KEY_PICON_WIDTH, 58) if PartnerBoxIconsEnabled: # Partnerbox Clock Icons self.remote_clock_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock.png') self.remote_clock_add_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_add.png') self.remote_clock_pre_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_pre.png') self.remote_clock_post_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_post.png') self.remote_clock_prepost_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_prepost.png')
def __init__(self, session, plugin, type, text, tuner, tunertype, tunernumber, name="", number=None, channel="", reference="", begin=0, end=0, endless=False, filename="", client="", ip="", port=""): #TODO use parameter ref instead of number and channel TunerStateBase.__init__(self, session) self.removeTimer = eTimer() try: self.removeTimer_conn = self.removeTimer.timeout.connect( self.remove) except: self.removeTimer.callback.append(self.remove) try: from Components.ServiceList import PiconLoader self.piconLoader = PiconLoader() except: self.piconLoader = None try: from Tools.FindPicon import findPicon self.findPicon = True except: self.findPicon = False self.plugin = plugin self.type = type self.text = text self.tuner = tuner self.tunertype = tunertype self.tunernumber = tunernumber self.name = name self.number = number self.channel = channel self.reference = reference if self.piconLoader: self.picon = self.piconLoader.getPicon(reference) else: self.picon = None if self.findPicon: from Tools.FindPicon import findPicon pngname = findPicon(reference) if pngname != "": self.picon = LoadPixmap(cached=True, path=pngname) self.filename = filename + ".ts" self.destination = filename and os.path.dirname(filename) self.filesize = None self.freespace = None self.client = client self.ip = ip self.port = port self.begin = begin self.end = end self.endless = endless self.timeleft = None self.timeelapsed = None self.duration = None self.progress = None
class TunerState(TunerStateBase): def __init__(self, session, plugin, type, text, tuner, tunertype, tunernumber, name="", number=None, channel="", reference="", begin=0, end=0, endless=False, filename="", client="", ip="", port=""): #TODO use parameter ref instead of number and channel TunerStateBase.__init__(self, session) self.removeTimer = eTimer() try: self.removeTimer_conn = self.removeTimer.timeout.connect( self.remove) except: self.removeTimer.callback.append(self.remove) try: from Components.ServiceList import PiconLoader self.piconLoader = PiconLoader() except: self.piconLoader = None try: from Tools.FindPicon import findPicon self.findPicon = True except: self.findPicon = False self.plugin = plugin self.type = type self.text = text self.tuner = tuner self.tunertype = tunertype self.tunernumber = tunernumber self.name = name self.number = number self.channel = channel self.reference = reference if self.piconLoader: self.picon = self.piconLoader.getPicon(reference) else: self.picon = None if self.findPicon: from Tools.FindPicon import findPicon pngname = findPicon(reference) if pngname != "": self.picon = LoadPixmap(cached=True, path=pngname) self.filename = filename + ".ts" self.destination = filename and os.path.dirname(filename) self.filesize = None self.freespace = None self.client = client self.ip = ip self.port = port self.begin = begin self.end = end self.endless = endless self.timeleft = None self.timeelapsed = None self.duration = None self.progress = None def updateName(self, name): self.name = name def updateNumberChannel(self, number, channel): self.number = number self.channel = channel def updatePicon(self): self["picon"].hide() if self.piconLoader: self.picon = self.piconLoader.getPicon(self.reference) else: self.picon = None if self.findPicon: from Tools.FindPicon import findPicon pngname = findPicon(self.reference) if pngname != "": self.picon = LoadPixmap(cached=True, path=pngname) self["picon"].instance.setScale(2) if self.picon is not None: self["picon"].instance.setPixmap(self.picon) self["picon"].show() def updateFilename(self, filename): self.filename = filename + ".ts" def updateType(self, type): if self.type != type: self.type = type if self.type == FINISHED: log.debug("IBTS updateType FINISHED") self.tuner = _("-") self.tunertype = _("-") # Check if timer is already started if not self.removeTimer.isActive(): # Check if timeout is configured timeout = int( config.infobartunerstate.timeout_finished_entries.value) if timeout > 0: self.removeTimer.startLongTimer(timeout) def updateTimes(self, begin, end, endless): if begin is not None: self.begin = begin if end is not None: self.end = end if endless is not None: self.endless = endless def updateDynamicContent(self): # Time and progress now = time() begin = self.begin end = self.end duration = None timeleft = None timeelapsed = None progress = None duration = begin and end and end - begin if duration and duration < 0: duration = None if self.type == FINISHED or self.type == RECORD_FINISHED: # Finished events timeelapsed = None #duration elif begin and end and begin < now: timeelapsed = min(now - begin, duration) else: # Future event timeelapsed = None if not self.endless and self.end: if self.type == FINISHED or self.type == RECORD_FINISHED: # Finished events timeleft = None #0 elif begin and end and begin < now: timeleft = max(end - now, 0) else: # Future event timeleft = None if timeelapsed and duration: # Adjust the watched movie length (98% of movie length) # else we will never see the 100% # Alternative using math.ceil but then we won't see 0 length = duration / 100.0 * 98.0 # Calculate progress and round up progress = timeelapsed / length * 100.0 # Normalize progress if progress < 0: progress = 0 elif progress > 100: progress = 100 else: progress = None self.duration = duration and duration is not None and int( math.ceil((duration) / 60.0)) self.timeleft = timeleft and timeleft is not None and int( math.ceil((timeleft) / 60.0)) self.timeelapsed = timeelapsed and timeelapsed is not None and int( math.ceil((timeelapsed) / 60.0)) self.progress = progress and progress is not None and int(progress) #log.debug( "IBTS duration, timeleft, timeelapsed, progress", self.duration, self.timeleft, self.timeelapsed, self.progress ) #Adapted from: from Components.Harddisk import findMountPoint def mountpoint(path): path = os.path.realpath(path) if os.path.ismount(path) or len(path) == 0: return path return mountpoint(os.path.dirname(path)) def getDevicebyMountpoint(hdm, mountpoint): for x in hdm.partitions[:]: if x.mountpoint == mountpoint: return x.device return None def getHDD(hdm, part): for hdd in hdm.hdd: if hdd.device == part[:3]: return hdd return None def hddIsAvailable(path): # User specified to avoid HDD wakeup if it is sleeping from Components.Harddisk import harddiskmanager dev = getDevicebyMountpoint(harddiskmanager, mountpoint(path)) if dev is not None: hdd = getHDD(harddiskmanager, dev) if hdd is not None: if not hdd.isSleeping(): return True return False # File site and free disk space filename = self.filename self.filesize = None self.freespace = None if filename: for c in config.infobartunerstate.fields.dict().itervalues(): if c.value == "FileSize": break if c.value == "FreeSpace": break else: # We do not need to calculate the following values return # We need a replacement function for ismount # Bad workaround - skip all pathes which start with /mnt if config.infobartunerstate.skip_mounts.value and filename.startswith( "/mnt/"): #os.path.ismount( filename ): pass elif config.infobartunerstate.wake_hdd.value or hddIsAvailable( filename): if os.path.exists(filename): filesize = os.path.getsize(filename) self.filesize = int(filesize / (1024 * 1024)) try: stat = os.statvfs(filename) self.freespace = int( (stat.f_bfree / 1000 * stat.f_bsize / 1000) / 1024) #self.freespace = os.stat(filename).st_size/1048576) except OSError: pass def update(self): self.updateDynamicContent() height = self.instance.size().height() widths = [] # Set background transparency if not config.infobartunerstate.background_transparency.value: self["Background"].show() else: self["Background"].hide() self["Type"].hide() self["Progress"].hide() self["picon"].hide() for i, c in enumerate( config.infobartunerstate.fields.dict().itervalues()): fieldid = "Field" + str(i) field = c.value text = "" #log.debug( "IBTS DEBUG", self.plugin, field ) if field == "TypeIcon": self["Type"].show() if self.type == TIMER: pixmapnum = ICON_TIMER elif self.type == RECORD: pixmapnum = ICON_RECORD elif self.type == FINISHED: pixmapnum = ICON_FINISHED elif self.type == INFO: pixmapnum = ICON_INFO elif self.type == LIVE: pixmapnum = ICON_LIVE elif self.type == UNKNOWN: pixmapnum = ICON_UNKNOWN elif self.type == STREAM: pixmapnum = ICON_STREAM elif self.type == PIP: pixmapnum = ICON_PIP elif self.type == RECORD_FINISHED: pixmapnum = ICON_RECORD_FINISHED lenpixmaps = len(self["Type"].pixmaps) log.debug("IBTS len pixmaps", lenpixmaps) if lenpixmaps < (pixmapnum): # Set Info as default pixmapnum = ICON_INFO self["Type"].setPixmapNum(pixmapnum) # No resize necessary widths.append(self.typewidth) continue elif field == "TypeText": text = _(self.text) elif field == "Tuner": if self.tuner: text = self.tuner elif field == "TunerType": if self.tunertype: text = self.tunertype elif field == "Number": if isinstance(self.number, int): text = _("%d") % (self.number) elif isinstance(self.number, basestring): text = self.number elif field == "Channel": text = self.channel elif field == "Name": text = self.name elif field == "TimeLeft": if self.endless: # Add infinity symbol for indefinitely recordings text = INFINITY elif isinstance(self.timeleft, int): # Show timeleft recording time text = _("%d Min") % (self.timeleft) elif field == "TimeElapsed": if isinstance(self.timeelapsed, int): text = _("%d Min") % (self.timeelapsed) elif field == "TimeLeftDuration": # Calculate timeleft minutes if self.endless: # Add infinity symbol for indefinitely recordings text = INFINITY elif self.type is FINISHED: if isinstance(self.duration, int): text = _("%d Min") % (self.duration) elif isinstance(self.timeleft, int): # Show timeleft recording time text = _("%d Min") % (self.timeleft) elif field == "Begin": lbegin = self.begin and localtime(self.begin) text = lbegin and strftime( config.infobartunerstate.time_format_begin.value, lbegin) elif field == "End": lend = self.end and localtime(self.end) text = lend and strftime( config.infobartunerstate.time_format_end.value, lend) elif field == "BeginEnd": if self.progress is None: lbegin = self.begin and localtime(self.begin) text = lbegin and strftime( config.infobartunerstate.time_format_begin.value, lbegin) elif self.progress > 0: lend = self.end and localtime(self.end) text = lend and strftime( config.infobartunerstate.time_format_end.value, lend) elif field == "Duration": if isinstance(self.duration, int): text = _("%d Min") % (self.duration) elif field == "TimerProgressText": if isinstance(self.progress, int): text = _("%d %%") % (self.progress) elif field == "TimerProgressGraphical": if self.progress is not None: self["Progress"].setValue(self.progress) self["Progress"].show() # No resize necessary widths.append(self.progresswidth) else: if not config.infobartunerstate.placeholder_pogressbar.value: widths.append(0) else: widths.append(self.progresswidth) continue elif field == "ChannelIcon": if self.picon is not None: if not self.piconLoader: self["picon"].instance.setScale(2) self["picon"].instance.setPixmap(self.picon) self["picon"].show() # No resize necessary widths.append(self.piconwidth) else: if not config.infobartunerstate.placeholder_pogressbar.value: widths.append(0) else: widths.append(self.piconwidth) continue elif field == "TimerDestination": text = self.destination elif field == "StreamClient": text = self.client or self.ip elif field == "StreamClientPort": if self.port: text = self.client or self.ip text += ":" + str(self.port) elif field == "DestinationStreamClient": text = self.destination or self.client or self.ip elif field == "FileSize": if isinstance(self.filesize, int): text = _("%d MB") % (self.filesize) elif field == "FreeSpace": if isinstance(self.freespace, int): text = _("%d GB") % (self.freespace) elif field == "None": # text is already initialized with "" pass # Set text, append field, resize field and append width self[fieldid].setText(text) # Set horizontal alignment if field == 'Number' or field == 'TimeLeftDuration' or field == 'TimeLeft' or field == 'TimeElapsed' or field == 'Duration' or field == 'TimerProgressText' or field == 'FileSize' or field == 'FreeSpace': self[fieldid].instance.setHAlign( 2 ) # import _enigma # alignRight = _enigma.eLabel_alignRight #Workaround#1 self[fieldid].instance.resize(eSize(1000, height)) width = max(self[fieldid].instance.calculateSize().width(), 0) #log.debug( width ) #Workaround#2: Width calculation seems to be not enough width = int(width * 1.10) #Workaround#3: Calculation of left aligned fields seems to be broken if 0 < width and width < 30: width = 30 #log.debug( "IBTS Update", field, width, self[fieldid].instance.calculateSize().width() ) #self[fieldid].instance.resize( eSize(width, height) ) widths.append(width) self.widths = widths
class EPGSearchList(EPGList): def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer=None): EPGList.__init__(self, type, selChangedCB, timer) self.l.setBuildFunc(self.buildEPGSearchEntry) self.piconLoader = PiconLoader() sizes = componentSizes[EPGList.SKIN_COMPONENT_KEY] self._iconWidth = sizes.get(EPGList.SKIN_COMPONENT_ICON_WIDTH, 21) self._iconHeight = sizes.get(EPGList.SKIN_COMPONENT_ICON_HEIGHT, 21) self._iconHPos = sizes.get(EPGList.SKIN_COMPONENT_ICON_HPOS, 4) self._itemMargin = sizes.get(EPGList.SKIN_COMPONENT_ITEM_MARGIN, 10) servicelist_sizes = componentSizes["ServiceList"] self._picon_width = servicelist_sizes.get(ServiceList.KEY_PICON_WIDTH, 58) if PartnerBoxIconsEnabled: # Partnerbox Clock Icons self.remote_clock_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock.png' ) self.remote_clock_add_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_add.png' ) self.remote_clock_pre_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_pre.png' ) self.remote_clock_post_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_post.png' ) self.remote_clock_prepost_pixmap = LoadPixmap( '/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_prepost.png' ) def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): rec1 = beginTime and self.timer.isInTimer(eventId, beginTime, duration, service) # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and isInRemoteTimer(self, beginTime, duration, service) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename serviceName = serviceref.getServiceName() + ": " #delete serviceName if set it in setup and it is most matched service if config.plugins.epgsearch.show_sname_in_title.value and service == self.mostSearchService: serviceName = "" res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r1.height(), 0, RT_HALIGN_RIGHT | RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d" % (t[2], t[1], t[3], t[4])) ] #add picon if set this option in setup picon = None if config.plugins.epgsearch.show_picon.value: picon = self.piconLoader.getPicon(service) left_pos = r3.left() if picon is not None: res.append( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, left_pos, 2, self._picon_width, r3.height() - 3, picon)) left_pos = r3.left() + self._picon_width + self._itemMargin serviceName = "" #if load picon delete servicename if rec1 or rec2: if rec1: clock_pic = self.getClockPixmap(service, beginTime, duration, eventId) # maybe Partnerbox too if rec2: clock_pic_partnerbox = getRemoteClockPixmap( self, service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self, service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local res.extend( ((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos + self._iconWidth + self._itemMargin, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, left_pos + self._iconWidth * 2 + self._itemMargin * 2, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceName + EventName))) else: res.extend(((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, left_pos + self._iconWidth + self._itemMargin, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceName + EventName))) else: res.append( (eListboxPythonMultiContent.TYPE_TEXT, left_pos, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT | RT_VALIGN_CENTER, serviceName + EventName)) return res
class EPGSearchList(EPGList): def __init__(self, type=EPG_TYPE_SINGLE, selChangedCB=None, timer=None): EPGList.__init__(self, type, selChangedCB, timer) self.l.setBuildFunc(self.buildEPGSearchEntry) self.piconLoader = PiconLoader() sizes = componentSizes[EPGList.SKIN_COMPONENT_KEY] self._iconWidth = sizes.get(EPGList.SKIN_COMPONENT_ICON_WIDTH, 21) self._iconHeight = sizes.get(EPGList.SKIN_COMPONENT_ICON_HEIGHT, 21) self._iconHPos = sizes.get(EPGList.SKIN_COMPONENT_ICON_HPOS, 4) self._itemMargin = sizes.get(EPGList.SKIN_COMPONENT_ITEM_MARGIN, 10) servicelist_sizes = componentSizes["ServiceList"] self._picon_width = servicelist_sizes.get(ServiceList.KEY_PICON_WIDTH, 58) if PartnerBoxIconsEnabled: # Partnerbox Clock Icons self.remote_clock_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock.png') self.remote_clock_add_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_add.png') self.remote_clock_pre_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_pre.png') self.remote_clock_post_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_post.png') self.remote_clock_prepost_pixmap = LoadPixmap('/usr/lib/enigma2/python/Plugins/Extensions/Partnerbox/icons/remote_epgclock_prepost.png') def buildEPGSearchEntry(self, service, eventId, beginTime, duration, EventName): rec1 = beginTime and self.timer.isInTimer(eventId, beginTime, duration, service) # Partnerbox if PartnerBoxIconsEnabled: rec2 = beginTime and isInRemoteTimer(self,beginTime, duration, service) else: rec2 = False r1 = self.weekday_rect r2 = self.datetime_rect r3 = self.descr_rect t = localtime(beginTime) serviceref = ServiceReference(service) # for Servicename serviceName = serviceref.getServiceName() + ": " #delete serviceName if set it in setup and it is most matched service if config.plugins.epgsearch.show_sname_in_title.value and service == self.mostSearchService: serviceName = "" res = [ None, # no private data needed (eListboxPythonMultiContent.TYPE_TEXT, r1.left(), r1.top(), r1.width(), r1.height(), 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, self.days[t[6]]), (eListboxPythonMultiContent.TYPE_TEXT, r2.left(), r2.top(), r2.width(), r1.height(), 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4])) ] #add picon if set this option in setup picon = None if config.plugins.epgsearch.show_picon.value: picon = self.piconLoader.getPicon(service) left_pos = r3.left() if picon is not None: res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, left_pos, 2, self._picon_width, r3.height()-3, picon)) left_pos = r3.left() + self._picon_width + self._itemMargin serviceName = "" #if load picon delete servicename if rec1 or rec2: if rec1: clock_pic = self.getClockPixmap(service, beginTime, duration, eventId) # maybe Partnerbox too if rec2: clock_pic_partnerbox = getRemoteClockPixmap(self,service, beginTime, duration, eventId) else: clock_pic = getRemoteClockPixmap(self,service, beginTime, duration, eventId) if rec1 and rec2: # Partnerbox and local res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic), (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos + self._iconWidth + self._itemMargin, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic_partnerbox), (eListboxPythonMultiContent.TYPE_TEXT, left_pos + self._iconWidth*2 + self._itemMargin*2, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceName + EventName))) else: res.extend(( (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, left_pos, self._iconHPos, self._iconWidth, self._iconHeight, clock_pic), (eListboxPythonMultiContent.TYPE_TEXT, left_pos + self._iconWidth + self._itemMargin, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceName + EventName))) else: res.append((eListboxPythonMultiContent.TYPE_TEXT, left_pos, r3.top(), r3.width(), r3.height(), 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, serviceName + EventName)) return res