コード例 #1
0
def PlxCategory(url):
    tmpList = []
    list = common.plx2list(url)
    background = list[0]["background"]
    for channel in list[1:]:
        iconimage = "" if not channel.has_key(
            "thumb") else common.GetEncodeString(channel["thumb"])
        name = common.GetEncodeString(channel["name"])
        if channel["type"] == 'playlist':
            AddDir("[COLOR blue][{0}][/COLOR]".format(name),
                   channel["url"].encode("utf-8"),
                   1,
                   iconimage,
                   background=background.encode("utf-8"))
        else:
            AddDir(name,
                   channel["url"].encode("utf-8"),
                   3,
                   iconimage,
                   isFolder=False,
                   background=background)
            tmpList.append({
                "url": channel["url"],
                "image": iconimage.decode("utf-8"),
                "name": name.decode("utf-8")
            })

    common.SaveList(tmpListFile, tmpList)
コード例 #2
0
def PlxCategory(url, cache):
    tmpList = []
    chList = common.plx2list(url, cache)
    background = chList[0]["background"]
    for channel in chList[1:]:
        iconimage = "" if not channel.has_key(
            "thumb") else common.GetEncodeString(channel["thumb"])
        name = common.GetEncodeString(channel["name"])
        if channel["type"] == 'playlist':
            AddDir("[{0}]".format(name),
                   channel["url"],
                   1,
                   iconimage,
                   background=background)
        else:
            AddDir(name,
                   channel["url"],
                   3,
                   iconimage,
                   isFolder=False,
                   IsPlayable=True,
                   background=background)
            tmpList.append({
                "url": channel["url"],
                "image": iconimage,
                "name": name
            })

    common.SaveList(tmpListFile, tmpList)
コード例 #3
0
ファイル: default.py プロジェクト: alonir/xbmc-israel
def PlxCategory(url):
	list = common.plx2list(url)
	for channel in list:
		iconimage = "" if not channel.has_key("thumb") else channel["thumb"]
		if channel["type"] == 'playlist':
			addDir("[COLOR blue][{0}][/COLOR]".format(channel["name"]).encode('utf-8') ,channel["url"], 1, iconimage)
		else:
			addDir(channel["name"].encode('utf-8') ,channel["url"], 3, iconimage, isFolder=False)
コード例 #4
0
def PlxCategory(url):
	tmpList = []
	list = common.plx2list(url)
	background = list[0]["background"]
	for channel in list[1:]:
		iconimage = "" if not channel.has_key("thumb") else common.GetEncodeString(channel["thumb"])
		name = common.GetEncodeString(channel["name"])
		if channel["type"] == 'playlist':
			AddDir("[COLOR blue][{0}][/COLOR]".format(name) ,channel["url"].encode("utf-8"), 1, iconimage, background=background.encode("utf-8"))
		else:
			AddDir(name, channel["url"].encode("utf-8"), 3, iconimage, isFolder=False, background=background)
			tmpList.append({"url": channel["url"], "image": iconimage.decode("utf-8"), "name": name.decode("utf-8")})
			
	common.SaveList(tmpListFile, tmpList)
コード例 #5
0
def PlxCategory(url):
    list = common.plx2list(url)
    for channel in list:
        iconimage = "" if not channel.has_key("thumb") else channel["thumb"]
        if channel["type"] == 'playlist':
            addDir(
                "[COLOR blue][{0}][/COLOR]".format(
                    channel["name"]).encode('utf-8'), channel["url"], 1,
                iconimage)
        else:
            addDir(channel["name"].encode('utf-8'),
                   channel["url"],
                   3,
                   iconimage,
                   isFolder=False)