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


Python ChannelList.cleanLabels方法代码示例

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


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

示例1: APP

# 需要导入模块: from ChannelList import ChannelList [as 别名]
# 或者: from ChannelList.ChannelList import cleanLabels [as 别名]

#.........这里部分代码省略.........
        
        elif action in ACTION_MOVE_RIGHT:
            print 'ACTION_MOVE_RIGHT'
            
        elif action in ACTION_PAGEDOWN: 
            print 'ACTION_PAGEDOWN'
                 
        elif action in ACTION_PAGEUP: 
            print 'ACTION_PAGEUP'
 
        elif action in ACTION_SELECT_ITEM:
            print 'ACTION_SELECT_ITEM'
                
                
    def closeAPPS(self):
        self.log('closeAPPS')
        self.close()
        
        
    def fillPlugins(self, type='video'):
        self.log('fillPlugins, type = ' + type)
        json_query = ('{"jsonrpc":"2.0","method":"Addons.GetAddons","params":{"type":"xbmc.addon.%s","properties":["name","path","thumbnail","description","fanart","summary"]}, "id": 1 }'%type)
        json_detail = self.chanlist.sendJSON(json_query)
        detail = re.compile( "{(.*?)}", re.DOTALL ).findall(json_detail)
        for f in detail:
            names = re.search('"name" *: *"(.*?)",', f)
            paths = re.search('"addonid" *: *"(.*?)",', f)
            thumbnails = re.search('"thumbnail" *: *"(.*?)",', f)
            fanarts = re.search('"fanart" *: *"(.*?)",', f)
            descriptions = re.search('"description" *: *"(.*?)",', f)
            if not descriptions:
                descriptions = re.search('"summary" *: *"(.*?)",', f)
            if descriptions:
                description = self.chanlist.cleanLabels(descriptions.group(1))
            else:
                description = ''
            if names and paths:
                name = self.chanlist.cleanLabels(names.group(1))
                path = paths.group(1)
                if type == 'video' and path.startswith('plugin.video'):
                    thumbnail = removeNonAscii(thumbnails.group(1))
                    fanart = removeNonAscii(fanarts.group(1))
                    self.Items = xbmcgui.ListItem(label=name, thumbnailImage = thumbnail)
                    self.Items.setIconImage(thumbnail)
                    self.Items.setProperty("mediapath", path)
                    self.Items.setProperty("Fanart_Image", fanart)
                    
                    infoList = {}
                    infoList['mediatype']     = type
                    infoList['mpaa']          = 'Unknown'
                    infoList['tvshowtitle']   =  name
                    infoList['title']         =  name
                    infoList['originaltitle'] = 'originaltitle'
                    infoList['sorttitle']     = 'sorttitle'
                    infoList['studio']        = 'Studio'
                    infoList['genre']         = 'Genre'
                    infoList['plot']          = 'Plot'
                    infoList['plotoutline']   = 'plotoutline'
                    infoList['tagline']       = 'tagline'
                    infoList['dateadded']     = 'dateadded'
                    infoList['premiered']     = 'premiered'
                    infoList['aired']         = 'aired'
                    infoList['code']          = 'code'
                    infoList['lastplayed']    = 'lastplayed'
                    # infoList['album']         = 'album'
                    # infoList['artist']        = ['artist']
开发者ID:popookitty,项目名称:PseudoTV_Live,代码行数:70,代码来源:APP.py

示例2: __init__

# 需要导入模块: from ChannelList import ChannelList [as 别名]
# 或者: from ChannelList.ChannelList import cleanLabels [as 别名]
class Migrate:
    def __init__(self):
        self.chanlist = ChannelList()
        chkLowPower()
        
        
    def log(self, msg, level = xbmc.LOGDEBUG):
        log('Migrate: ' + msg, level)
          
   
    def onInit(self):
        self.log("onInit")
        
        
    def autoTune(self):
        self.log("autoTune")
        if REAL_SETTINGS.getSetting("Autotune") == "true" and REAL_SETTINGS.getSetting("Warning1") == "true":
            self.log('starting autoTune')
            Youtube = self.chanlist.youtube_player_ok()
            self.chanlist.background = True
            self.chanlist.makenewlists = True
            self.chanlist.forceReset = True
            self.myOverlay.setBackgroundStatus("Initializing: Autotuning",0,string2=" ")
            
            #Reserve channel check 
            channelNum = 1       
            if REAL_SETTINGS.getSetting("reserveChannels") == "true":
                self.log('autoTune, using reserve Channels')
                channelNum = 500
            baseNum = channelNum
            self.log('autoTune, Starting channelNum = ' + str(baseNum))
            
            # LiveTV - PVR
            if REAL_SETTINGS.getSetting("autoFindLivePVR") == "true":
                self.log("autoTune, adding Live PVR Channels")
                channelNum = baseNum
                PVRChannels = self.chanlist.getPVRChannels()
                for i in range(len(PVRChannels)):
                    try:
                        CHid = PVRChannels[i][0]
                        CHname = self.chanlist.cleanLabels(PVRChannels[i][1])
                        CHthmb = PVRChannels[i][2]
                        if REAL_SETTINGS.getSetting("respectChannels") == "true":
                            channelNum = self.chkChannelNum(int(CHid))
                        else:
                            channelNum = self.chkChannelNum(channelNum)
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_type", "8")
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_time", "0")
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_1", CHid)
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_2", self.chanlist.getPVRLink(i))
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_3", 'pvr')
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_1_id", "1")
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_1_opt_1", CHname + ' PVR')
                        rulecnt = 1
                        if isLowPower() == True:
                            rulecnt = 2
                            ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_2_id", "23")
                            ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_2_opt_1", 'No')
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rulecount", "%s" %str(rulecnt))
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_changed", "true")  
                        self.myOverlay.setBackgroundStatus("Initializing: Autotuning adding PVR channels",string2=CHname,progress=int(channelNum*100//CHANNEL_LIMIT))
                    except:
                        pass
            
            # LiveTV - HDHomeRun           
            if REAL_SETTINGS.getSetting("autoFindLiveHDHR")  == "true":
                self.log("autoTune, adding Live HDHomeRun Channels")
                channelNum = baseNum
                self.chanlist.cached_readXMLTV = []
                HDHRChannels = self.chanlist.getHDHRChannels(True)
                for i in range(len(HDHRChannels)):
                    try:
                        CHid = HDHRChannels[i][0]
                        CHname = self.chanlist.cleanLabels(HDHRChannels[i][1])
                        link = HDHRChannels[i][4]
                        if REAL_SETTINGS.getSetting("respectChannels") == "true":
                            channelNum = self.chkChannelNum(int(CHid))
                        else:
                            channelNum = self.chkChannelNum(channelNum)
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_type", "8")
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_time", "0")
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_1", CHid)
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_2", link)
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_3", "hdhomerun")
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_1_id", "1")
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_1_opt_1", CHname + ' HDHR')
                        rulecnt = 1
                        if isLowPower() == True:
                            rulecnt = 2
                            ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_2_id", "23")
                            ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_2_opt_1", 'No')
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rulecount", "%s" %str(rulecnt))
                        ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_changed", "true")     
                        self.myOverlay.setBackgroundStatus("Initializing: Autotuning adding HDHomeRun channels",string2=CHname,progress=int(channelNum*100//CHANNEL_LIMIT))
                    except Exception,e:
                        self.log("autoFindLiveHD 2, Failed! " + str(e))
             
            # LiveTV - USTVnow
            if REAL_SETTINGS.getSetting("autoFindUSTVNOW") == "true" and isUSTVnow() != False:
                self.log("autoTune, adding USTVnow Channels")
#.........这里部分代码省略.........
开发者ID:PseudoTV,项目名称:PseudoTV_Live,代码行数:103,代码来源:Migrate.py


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