本文整理汇总了Python中addon.common.addon.Addon.add_item方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.add_item方法的具体用法?Python Addon.add_item怎么用?Python Addon.add_item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.add_item方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: int
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_item [as 别名]
addon_handle = int(sys.argv[1])
AddonPath = addon.get_path()
IconPath = os.path.join(AddonPath , "resources/media/")
fanart = os.path.join(AddonPath + "/fanart.jpg")
def icon_path(filename):
if 'http://' in filename:
return filename
return os.path.join(IconPath, filename)
args = urlparse.parse_qs(sys.argv[2][1:])
mode = args.get('mode', None)
if mode is None:
addon.add_item({'mode': 'live_sport'}, {'title':'Live Sport'}, img=icon_path('live_sport.jpg'), fanart=fanart,is_folder=True)
addon.add_item({'mode': 'live_tv'}, {'title':'Live TV'}, img=icon_path('live_tv.jpg'), fanart=fanart,is_folder=True)
addon.add_item({'mode': 'p2p_corner'}, {'title':'P2P Corner'}, img=icon_path('p2p_corner.jpg'), fanart=fanart,is_folder=True)
addon.add_item({'mode': 'on_demand_sport_categories'}, {'title':'Sport On Demand'}, img=icon_path('sport_on_demand.jpg'), fanart=fanart,is_folder=True)
#addon.add_item({'mode': 'blogs'}, {'title':'Blogs'}, img=icon_path('blogs.jpg'), fanart=fanart,is_folder=True)
addon.add_item({'mode': 'tools'}, {'title':'Tools'}, img=icon_path('tools.jpg'), fanart=fanart,is_folder=True)
addon.add_item({'mode': 'my_castaway'}, {'title':'My Castaway'}, img=icon_path('my_castaway.jpg'), fanart=fanart,is_folder=True)
addon.end_of_directory()
from resources.lib.modules import cache, control, changelog
cache.get(changelog.get, 600000000, control.addonInfo('version'), table='changelog')
elif mode[0]=='my_castaway':
#addon.add_item({'mode': 'favourites'}, {'title':'Favourites'}, img=icon_path('favourites.jpg'), fanart=fanart,is_folder=True)
#addon.add_item({'mode': 'my_lists'}, {'title':'My Lists'}, img=icon_path('my_lists.jpg'), fanart=fanart,is_folder=True)
示例2: icon_path
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_item [as 别名]
fanart = os.path.join(AddonPath + "/fanart.jpg")
def icon_path(filename):
if "http://" in filename:
return filename
return os.path.join(IconPath, filename)
args = urlparse.parse_qs(sys.argv[2][1:])
mode = args.get("mode", None)
if mode is None:
addon.add_item(
{"mode": "live_sport"}, {"title": "Live Sport"}, img=icon_path("live_sport.jpg"), fanart=fanart, is_folder=True
)
addon.add_item(
{"mode": "live_tv"}, {"title": "Live TV"}, img=icon_path("live_tv.jpg"), fanart=fanart, is_folder=True
)
addon.add_item(
{"mode": "p2p_corner"}, {"title": "P2P Corner"}, img=icon_path("p2p_corner.jpg"), fanart=fanart, is_folder=True
)
addon.add_item(
{"mode": "on_demand_sport_categories"},
{"title": "Sport On Demand"},
img=icon_path("sport_on_demand.jpg"),
fanart=fanart,
is_folder=True,
)
addon.add_item(