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


Python PLUGIN.url_for方法代码示例

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


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

示例1: channelVideos

# 需要导入模块: from constants import PLUGIN [as 别名]
# 或者: from constants.PLUGIN import url_for [as 别名]
def channelVideos(name):
    items = [{'label': PLUGIN.get_string(30078), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, past='true')},
             {'label': PLUGIN.get_string(30079), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, past='false')}]
    PLUGIN.set_content(utils.getContentType())
    return items
开发者ID:spiffomatic64,项目名称:Twitch.tv-on-XBMC,代码行数:9,代码来源:routes.py

示例2: search

# 需要导入模块: from constants import PLUGIN [as 别名]
# 或者: from constants.PLUGIN import url_for [as 别名]
def search():
    query = PLUGIN.keyboard('', PLUGIN.get_string(30007))
    if query:
        target = PLUGIN.url_for(endpoint='searchresults', query=query, index='0')
    else:
        target = PLUGIN.url_for(endpoint='createMainListing')
    PLUGIN.redirect(target)
开发者ID:spiffomatic64,项目名称:Twitch.tv-on-XBMC,代码行数:9,代码来源:routes.py

示例3: channelVideos

# 需要导入模块: from constants import PLUGIN [as 别名]
# 或者: from constants.PLUGIN import url_for [as 别名]
def channelVideos(name):
    items = [{'label': PLUGIN.get_string(30078), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, broadcast_type='archive')},
             {'label': PLUGIN.get_string(30113), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, broadcast_type='upload')},
             {'label': PLUGIN.get_string(30079), 'icon': Images.ICON, 'thumbnail': Images.THUMB, 'art': utils.theArt(),
              'path': PLUGIN.url_for(endpoint='channelVideosList', name=name, index=0, broadcast_type='highlight')}]
    PLUGIN.set_content(utils.getContentType())
    return items
开发者ID:beastd,项目名称:Twitch.tv-on-XBMC,代码行数:11,代码来源:routes.py

示例4: contextClearPreviews

# 需要导入模块: from constants import PLUGIN [as 别名]
# 或者: from constants.PLUGIN import url_for [as 别名]
def contextClearPreviews():
    context_menu = []
    if PLUGIN.get_setting('live_previews_enable', unicode) == 'true':
        notify = str(notifyRefresh())
        context_menu.extend([(PLUGIN.get_string(30084), 'RunPlugin(%s)' %
                              PLUGIN.url_for(endpoint='clearLivePreviews', notify=notify))])
    return context_menu
开发者ID:Muus,项目名称:Twitch.tv-on-XBMC,代码行数:9,代码来源:utils.py

示例5: createFollowingList

# 需要导入模块: from constants import PLUGIN [as 别名]
# 或者: from constants.PLUGIN import url_for [as 别名]
def createFollowingList():
    username = utils.getUserName()
    if not username:
        utils.notification(PLUGIN.get_string(30095))
    else:
        streams = TWITCHTV.getFollowingStreams(username)
        liveStreams = [CONVERTER.convertStreamToListItem(stream) for stream in streams[Keys.LIVE]]
        liveStreams.insert(0, {'path': PLUGIN.url_for(endpoint='createFollowingList'), 'icon': Images.ICON,
                               'thumbnail': Images.THUMB, 'art': utils.theArt(), 'is_playable': False,
                               'label': PLUGIN.get_string(30012)})
        liveStreams.append({'path': PLUGIN.url_for(endpoint='createFollowingList'), 'icon': Images.ICON,
                            'thumbnail': Images.THUMB, 'art': utils.theArt(), 'is_playable': False,
                            'label': PLUGIN.get_string(30013)})
        liveStreams.extend([CONVERTER.convertFollowersToListItem(follower) for follower in streams[Keys.OTHERS]])
        utils.refreshPreviews()
        PLUGIN.set_content(utils.getContentType())
        return liveStreams
开发者ID:spiffomatic64,项目名称:Twitch.tv-on-XBMC,代码行数:19,代码来源:routes.py

示例6: createMainListing

# 需要导入模块: from constants import PLUGIN [as 别名]
# 或者: from constants.PLUGIN import url_for [as 别名]
def createMainListing():
    context_menu = []
    context_menu.extend(utils.contextClearPreviews())
    items = [
        {'label': PLUGIN.get_string(30005),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfFeaturedStreams')
         },
        {'label': PLUGIN.get_string(30001),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfGames', index='0')
         },
        {'label': PLUGIN.get_string(30008),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfChannels', index='0')
         },
        {'label': PLUGIN.get_string(30002),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createFollowingList')
         },
        {'label': PLUGIN.get_string(30066),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createFollowingGameList')
         },
        {'label': PLUGIN.get_string(30006),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListOfTeams', index='0')
         },
        {'label': PLUGIN.get_string(30098),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='createListForSelectedVideo')
         },
        {'label': PLUGIN.get_string(30003),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='search')
         },
        {'label': PLUGIN.get_string(30004),
         'icon': Images.ICON,
         'thumbnail': Images.THUMB,
         'art': utils.theArt(),
         'context_menu': context_menu,
         'path': PLUGIN.url_for(endpoint='showSettings')
         }
    ]
    PLUGIN.set_content(utils.getContentType())
    return items
开发者ID:spiffomatic64,项目名称:Twitch.tv-on-XBMC,代码行数:72,代码来源:routes.py

示例7: linkToNextPage

# 需要导入模块: from constants import PLUGIN [as 别名]
# 或者: from constants.PLUGIN import url_for [as 别名]
def linkToNextPage(target, currentIndex, **kwargs):
    return {'label': PLUGIN.get_string(30011),
            'icon': Images.ICON,
            'thumbnail': Images.THUMB,
            'art': theArt(),
            'path': PLUGIN.url_for(target, index=str(currentIndex + 1), **kwargs)}
开发者ID:Muus,项目名称:Twitch.tv-on-XBMC,代码行数:8,代码来源:utils.py


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