当前位置: 首页>>代码示例>>Python>>正文


Python ChannelList.appendChannel方法代码示例

本文整理汇总了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.")
开发者ID:PseudoTV,项目名称:PseudoTV_Archive,代码行数:64,代码来源:ChannelListThread.py

示例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
开发者ID:kyotocafe,项目名称:XBMC-PseudoTV,代码行数:65,代码来源:ChannelListThread.py


注:本文中的ChannelList.ChannelList.appendChannel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。