本文整理汇总了Python中ChannelList.ChannelList.appendChannel方法的典型用法代码示例。如果您正苦于以下问题:Python ChannelList.appendChannel方法的具体用法?Python ChannelList.appendChannel怎么用?Python ChannelList.appendChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChannelList.ChannelList
的用法示例。
在下文中一共展示了ChannelList.appendChannel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ChannelListThread
# 需要导入模块: from ChannelList import ChannelList [as 别名]
# 或者: from ChannelList.ChannelList import appendChannel [as 别名]
class ChannelListThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.myOverlay = None
self.shouldExit = False
sys.setcheckinterval(25)
self.chanlist = ChannelList()
self.chanlist.sleepTime = 0.1
def log(self, msg, level = xbmc.LOGDEBUG):
log('ChannelListThread: ' + msg, level)
def run(self):
self.log("Starting")
self.shouldExit = False
self.chanlist.exitThread = False
if self.myOverlay == None:
self.log("Overlay not defined. Exiting.")
return
### TV TIME ###
prestageChannels = REAL_SETTINGS.getSetting('PrestageChannels') == "true"
if prestageChannels:
for i in range(self.myOverlay.maxChannels):
if self.shouldExit == True:
self.log("Closing thread")
return
self.log("Prestage Channel " + str(i + 1))
self.chanlist.prestageChannel(i + 1)
self.channelResetSetting = REAL_SETTINGS.getSetting('ChannelResetSetting')
if self.channelResetSetting == "0":
###############
for i in range(self.myOverlay.maxChannels):
modified = True
while modified == True and self.myOverlay.channels[i].isValid and self.myOverlay.channels[i].getTotalDuration() < PREP_CHANNEL_TIME:
modified = False
if self.shouldExit == True:
self.log("Closing thread")
return
time.sleep(2)
curtotal = self.myOverlay.channels[i].getTotalDuration()
self.chanlist.appendChannel(i + 1)
if self.shouldExit == True:
self.log("Closing thread")
return
time.sleep(2)
self.myOverlay.channels[i].setPlaylist(CHANNELS_LOC + "channel_" + str(i + 1) + ".m3u")
if self.myOverlay.channels[i].getTotalDuration() > curtotal:
modified = True
self.log("All channels up to date. Exiting thread.")
示例2: ChannelListThread
# 需要导入模块: from ChannelList import ChannelList [as 别名]
# 或者: from ChannelList.ChannelList import appendChannel [as 别名]
class ChannelListThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.myOverlay = None
self.shouldExit = False
sys.setcheckinterval(25)
self.chanlist = ChannelList()
self.chanlist.sleepTime = 0.1
self.paused = False
def log(self, msg, level = xbmc.LOGDEBUG):
log('ChannelListThread: ' + msg, level)
def run(self):
self.log("Starting")
self.shouldExit = False
self.chanlist.exitThread = False
if self.myOverlay == None:
self.log("Overlay not defined. Exiting.")
return
for i in range(self.myOverlay.maxChannels):
modified = True
while modified == True and self.myOverlay.channels[i].isValid and self.myOverlay.channels[i].getTotalDuration() < PREP_CHANNEL_TIME:
modified = False
if self.shouldExit == True:
self.log("Closing thread")
return
time.sleep(2)
curtotal = self.myOverlay.channels[i].getTotalDuration()
self.chanlist.appendChannel(i + 1)
# A do-while loop for the paused state
while True:
if self.shouldExit == True:
self.log("Closing thread")
return
time.sleep(2)
if self.paused == False:
break
self.myOverlay.channels[i].setPlaylist(CHANNELS_LOC + "channel_" + str(i + 1) + ".m3u")
if self.myOverlay.channels[i].getTotalDuration() > curtotal:
modified = True
self.log("All channels up to date. Exiting thread.")
def pause(self):
self.paused = True
def unpause(self):
self.paused = False