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


Python ChannelList.loadCustomPlaylists方法代码示例

本文整理汇总了Python中ChannelList.ChannelList.loadCustomPlaylists方法的典型用法代码示例。如果您正苦于以下问题:Python ChannelList.loadCustomPlaylists方法的具体用法?Python ChannelList.loadCustomPlaylists怎么用?Python ChannelList.loadCustomPlaylists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ChannelList.ChannelList的用法示例。


在下文中一共展示了ChannelList.loadCustomPlaylists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onInit

# 需要导入模块: from ChannelList import ChannelList [as 别名]
# 或者: from ChannelList.ChannelList import loadCustomPlaylists [as 别名]
    def onInit(self):
        self.log('onInit')
        migrate()
        self.channelLabelTimer = threading.Timer(5.0, self.hideChannelLabel)
        self.infoTimer = threading.Timer(5.0, self.hideInfo)
        self.background = self.getControl(101)
        self.getControl(102).setVisible(False)

        if not os.path.exists(GEN_CHAN_LOC):
            try:
                os.makedirs(GEN_CHAN_LOC)
            except:
                self.Error('Unable to create the cache directory')
                return

        self.myEPG = EPGWindow("script.pseudotv.EPG.xml", ADDON_INFO, "default")
        self.myEPG.MyOverlayWindow = self
        # Don't allow any actions during initialization
        self.actionSemaphore.acquire()

        ### TV TIME ###
        chn = ChannelList()
        # build meta files if first time loading
        if (
            REAL_SETTINGS.getSetting("bumpers") == "true" or 
            REAL_SETTINGS.getSetting("commercials") == "true" or  
            REAL_SETTINGS.getSetting("trailers") == "true"
            ):
            chn.buildMetaFiles() 

        chn.loadCustomPlaylists()

        if (REAL_SETTINGS.getSetting("autoFindMixGenres") == "true" or       
            REAL_SETTINGS.getSetting("autoFindMovieGenres") == "true" or        
            REAL_SETTINGS.getSetting("autoFindNetworks") == "true" or        
            REAL_SETTINGS.getSetting("autoFindStudios") == "true" or   
            REAL_SETTINGS.getSetting("autoFindTVGenres") == "true" or       
            REAL_SETTINGS.getSetting("autoFindTVShows") == "true" or
            REAL_SETTINGS.getSetting("autoFindMusicGenres") == "true" or
            REAL_SETTINGS.getSetting("autoFindLive") == "true"):
            chn.autoTune()
        ###############

        if self.readConfig() == False:
            return

        self.myEPG.channelLogos = self.channelLogos
        self.maxChannels = len(self.channels)

        ### TV TIME ###
        #if self.maxChannels == 0:
        #    self.Error('Unable to find any channels. Please configure the addon.')
        #    return
        if self.maxChannels == 0:
            dlg = xbmcgui.Dialog()
            
            autoTune = False
            if dlg.yesno("No Channels Configured", "Would you like TV Time to Auto Tune TV Network\nchannels the next time it loads?"):
                REAL_SETTINGS.setSetting("autoFindNetworks","true")
                autoTune = True

            if dlg.yesno("No Channels Configured", "Would you like TV Time to Auto Tune TV Genre\nchannels the next time it loads?"):
                REAL_SETTINGS.setSetting("autoFindTVGenres","true")
                autoTune = True

            if dlg.yesno("No Channels Configured", "Would you like TV Time to Auto Tune Movie Studio\nchannels the next time it loads?"):
                REAL_SETTINGS.setSetting("autoFindStudios","true")
                autoTune = True

            if dlg.yesno("No Channels Configured", "Would you like TV Time to Auto Tune Movie Genre\nchannels the next time it loads?"):
                REAL_SETTINGS.setSetting("autoFindMovieGenres","true")
                autoTune = True

            if dlg.yesno("No Channels Configured", "Would you like TV Time to Auto Tune Mix Genre\nchannels the next time it loads?"):
                REAL_SETTINGS.setSetting("autoFindMixGenres","true")
                autoTune = True

            if dlg.yesno("No Channels Configured", "Would you like TV Time to Auto Tune Music Genre\nchannels the next time it loads?"):
                REAL_SETTINGS.setSetting("autoFindMusicGenres","true")
                autoTune = True

            if dlg.yesno("No Channels Configured", "Would you like TV Time to Auto Tune Live\nchannels the next time it loads?"):
                REAL_SETTINGS.setSetting("autoFindLive","true")
                autoTune = True

            if autoTune:
                self.background.setVisible(True)
                self.end()
                return

            del dlg
        ###############
        
        found = False

        for i in range(self.maxChannels):
            if self.channels[i].isValid:
                found = True
                break

#.........这里部分代码省略.........
开发者ID:PseudoTV,项目名称:PseudoTV_Archive,代码行数:103,代码来源:Overlay.py


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