本文整理汇总了Python中ChannelList.ChannelList.walk方法的典型用法代码示例。如果您正苦于以下问题:Python ChannelList.walk方法的具体用法?Python ChannelList.walk怎么用?Python ChannelList.walk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChannelList.ChannelList
的用法示例。
在下文中一共展示了ChannelList.walk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ChannelList import ChannelList [as 别名]
# 或者: from ChannelList.ChannelList import walk [as 别名]
#.........这里部分代码省略.........
try:
CHname, path, thumb = USTVChannels[i]
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", CHname)
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_2", path)
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_3", "ustvnow")
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_1_id", "1")
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_1_opt_1", CHname + ' USTV')
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_2_id", "13")
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_2_opt_1", "2")
rulecnt = 2
if isLowPower() == True:
rulecnt = 3
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_3_id", "23")
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_rule_3_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 USTVnow channels",string2=CHname,progress=int(channelNum*100//CHANNEL_LIMIT))
except:
pass
# Custom Playlists
if REAL_SETTINGS.getSetting("autoFindCustom") == "true":
self.log("autoTune, adding Custom SmartPlaylists")
channelNum = baseNum
Music_path = 'special://profile/playlists/music'
Mixed_path = 'special://profile/playlists/mixed'
Video_path = 'special://profile/playlists/video'
xsp_path = [Music_path, Mixed_path, Video_path]
i = 0
for path in xsp_path:
xspLst = self.chanlist.walk(path,['.xsp'])
for xsp in xspLst:
if xsp.endswith('.xsp') and len(re.findall("channel_",xsp)) != 0:
i += 1
if REAL_SETTINGS.getSetting("respectChannels") == "true":
channelNum = self.chkChannelNum(int((re.findall("channel_(\d+)", xsp))[0]))
else:
channelNum = self.chkChannelNum(channelNum)
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_type", "0")
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_time", "0")
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_1", xbmc.translatePath(xsp))
ADDON_SETTINGS.setSetting("Channel_" + str(channelNum) + "_changed", "true")
self.myOverlay.setBackgroundStatus("Initializing: Autotuning adding Custom SmartPlaylists",string2=uni(self.chanlist.getSmartPlaylistName(xsp)),progress=int(channelNum*100//CHANNEL_LIMIT))
# Custom SuperFavs
if REAL_SETTINGS.getSetting("autoFindSuperFav") == "true" :
self.log("autoTune, adding Super Favourites")
channelNum = baseNum
plugin_details = self.chanlist.requestList('plugin://plugin.program.super.favourites')
for i in plugin_details:
include = False
try:
filetypes = re.search('"filetype" *: *"(.*?)"', i)
labels = re.search('"label" *: *"(.*?)"', i)
files = re.search('"file" *: *"(.*?)"', i)
#if core variables have info proceed
if filetypes and files and labels:
filetype = filetypes.group(1)
file = (files.group(1))