def _readCachedEpgData(self): ml = MessageListener() if not self.channelList: ml.signalMessage(ml.MSG_STATUS, "Where is that channel.conf? RTF!") return ml.signalMessage(ml.MSG_STATUS, "Reading programm info") msg = "Idle" try: self.progProvider.readEPGCache() ml.signalMessage(ml.MSG_REFRESH) # enforces a new list except IOError: msg = "No EPG data" except Exception as ex: msg = "Error reading cached EPG Data: " + str(ex.args[0]) self.configuration.logInfo(msg) ml.signalMessage(ml.MSG_STATUS, msg)
def __init__(self): ''' starts the app ''' self.configuration = Config() self.configuration.setupLogging("webdvb.log") self._lastMessage = None ml = MessageListener(); ml.addListener(ml.MSG_STATUS, self.storeLastMessage) # ml.addListener(ml.MSG_EPG, this.storeLastMessage) ml.addListener(ml.MSG_REFRESH, self.storeLastMessage) channelReader = ChannelReader() cPath = self.configuration.getChannelFilePath() channelReader.readChannels(cPath) self.channelList = channelReader.getChannels() self.progProvider = EPGProgramProvider(self, self.channelList, self.configuration) self._lastEpgRead = 0.0 # self._readCachedEpgData() self.checkEPGData()
def collectEPGList(self): epgBlockData = [] ml = MessageListener() for freq,channelName in self._frequencyDict.items(): dataSize =0; loop=0 msg="Scanning frequency:"+str(freq)+" ..." ml.signalMessage(ml.MSG_STATUS,msg) while dataSize < self.MIN_DATA_THRESHOLD: loop+=1 xmlData = self._readEPGFromDevice(channelName) dataSize = len(xmlData) msg="Block read:"+channelName+" ["+freq+"] size:"+str(dataSize) ml.signalMessage(ml.MSG_STATUS,msg) self.configuration.logInfo(msg) print msg if loop > 3: break; xmlData = self._fixTV_Grab(xmlData) if xmlData: epgBlockData.append(xmlData) return epgBlockData
def _readCachedEpgData(self): ml = MessageListener(); if not self.channelList: ml.signalMessage(self.MSG_STATUS, "Where is that channel.conf? RTF!") return ml.signalMessage(self.MSG_STATUS, "Reading programm info") msg = "Idle" try: self.progProvider.readEPGCache() ml.signalMessage(self.MSG_REFRESH, "Program info read") # enforces a new list except IOError: msg = "No EPG data" except Exception, ex: msg = "Error reading cached EPG Data: " + str(ex.args[0]) self.configuration.getLogger().exception(msg) print msg
def __init__(self): ''' starts the app ''' self.configuration = Config() self.configuration.setupLogging("dvb.log") channelReader = ChannelReader() cPath = self.configuration.getChannelFilePath() channelReader.readChannels(cPath) self.channelList = channelReader.getChannels() self.progProvider = EPGProgramProvider(self, self.channelList, self.configuration) recView = RecorderView(self.progProvider) ml = MessageListener() ml.addListener(ml.MSG_STATUS, recView.setStatusLine) ml.addListener(ml.MSG_EPG, recView.notifyEPGStatus) ml.addListener(ml.MSG_REFRESH, recView.refreshProgrammInfos) t1 = ReaderThread(False, self._readCachedEpgData) t1.start() recView.openView() #returns on close t1.join()
def __init__(self): ''' starts the app ''' self.configuration = Config() self.configuration.setupLogging("webdvb.log") self._lastMessage = None ml = MessageListener() ml.addListener(ml.MSG_STATUS, self.storeLastMessage) # ml.addListener(ml.MSG_EPG, this.storeLastMessage) ml.addListener(ml.MSG_REFRESH, self.storeLastMessage) channelReader = ChannelReader() cPath = self.configuration.getChannelFilePath() channelReader.readChannels(cPath) self.channelList = channelReader.getChannels() self.progProvider = EPGProgramProvider(self, self.channelList, self.configuration) self._lastEpgRead = 0.0 # self._readCachedEpgData() self.checkEPGData()
def collectEPGList(self): epgBlockData = [] ml = MessageListener() for freq, channelName in list(self._frequencyDict.items()): dataSize = 0 loop = 0 msg = "Scanning frequency:" + str(freq) + " ..." ml.signalMessage(ml.MSG_STATUS, msg) while dataSize < self.MIN_DATA_THRESHOLD: loop += 1 xmlData = self._readEPGFromDevice(channelName) dataSize = len(xmlData) msg = "Block read:" + channelName + " [" + freq + "] size:" + str( dataSize) ml.signalMessage(ml.MSG_STATUS, msg) self.configuration.logInfo(msg) print(msg) if loop > 3: break xmlData = self._fixTV_Grab(xmlData) if xmlData: epgBlockData.append(xmlData) return epgBlockData
def _dispatchMessage(self,aString): ml = MessageListener() ml.signalMessage(ml.MSG_STATUS,aString)
def _collectEPGFromDevice(self): ml = MessageListener() ml.signalMessage(ml.MSG_EPG, True) ml.signalMessage(ml.MSG_STATUS, "Retrieving new EPG data") epgUpdater = self.progProvider.getEPGUpdater() epgUpdater.updateDatabase() if epgUpdater.hasError(): ml.signalMessage(ml.MSG_STATUS, epgUpdater.getErrorMessage()) ml.signalMessage(ml.MSG_EPG, False) return ml.signalMessage(ml.MSG_REFRESH) # enforces redraw! ml.signalMessage(ml.MSG_STATUS, "EPG data up to date !") ml.signalMessage(ml.MSG_EPG, False)
def _collectEPGFromDevice(self): epgUpdater = self.progProvider.getEPGUpdater() self._updater.updateDatabase() if epgUpdater.hasError(): MessageListener().signalMessage(self.MSG_STATUS, epgUpdater.getErrorMessage())