本文整理汇总了Python中Configuration.Config.getChannelFilePath方法的典型用法代码示例。如果您正苦于以下问题:Python Config.getChannelFilePath方法的具体用法?Python Config.getChannelFilePath怎么用?Python Config.getChannelFilePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration.Config
的用法示例。
在下文中一共展示了Config.getChannelFilePath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WebRecorder
# 需要导入模块: from Configuration import Config [as 别名]
# 或者: from Configuration.Config import getChannelFilePath [as 别名]
class WebRecorder():
'''
API methods are called by the RecorderPlugin in the RecorderWebService module.
'''
# signal modes
# TODO change mode to STATUS und ERROR...
MSG_STATUS = MessageListener.MSG_STATUS
# MSG_EPG = MessageListener.MSG_EPG
MSG_REFRESH = MessageListener.MSG_REFRESH
# Modes or types of rec?
(MODE_DATA, MODE_REC, MODE_BLOCK) = range(0xA0, 0xA3)
(TYPE_HEAD, TYPE_PROG, TYPE_INFO) = range(3)
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 _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
self.configuration.logInfo(msg)
ml.signalMessage(self.MSG_STATUS, msg)