本文整理匯總了Python中xbmcplugin.SORT_METHOD_NONE屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmcplugin.SORT_METHOD_NONE屬性的具體用法?Python xbmcplugin.SORT_METHOD_NONE怎麽用?Python xbmcplugin.SORT_METHOD_NONE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類xbmcplugin
的用法示例。
在下文中一共展示了xbmcplugin.SORT_METHOD_NONE屬性的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: addLinkItem
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def addLinkItem(name, url, mode, params=1, iconimage='DefaultFolder.png', infoLabels=False, IsPlayable=True,
fanart=FANART, itemcount=1, contextmenu=None):
u = build_url({'mode': mode, 'foldername': name, 'ex_link': url, 'params': params})
liz = xbmcgui.ListItem(name)
art_keys = ['thumb', 'poster', 'banner', 'fanart', 'clearart', 'clearlogo', 'landscape', 'icon']
art = dict(zip(art_keys, [iconimage for x in art_keys]))
art['landscape'] = fanart if fanart else art['landscape']
art['fanart'] = fanart if fanart else art['landscape']
liz.setArt(art)
if not infoLabels:
infoLabels = {"title": name}
liz.setInfo(type="video", infoLabels=infoLabels)
if IsPlayable:
liz.setProperty('IsPlayable', 'true')
if contextmenu:
contextMenuItems = contextmenu
liz.addContextMenuItems(contextMenuItems, replaceItems=True)
ok = xbmcplugin.addDirectoryItem(handle=addon_handle, url=u, listitem=liz, isFolder=False, totalItems=itemcount)
xbmcplugin.addSortMethod(addon_handle, sortMethod=xbmcplugin.SORT_METHOD_NONE, label2Mask="%R, %Y, %P")
return ok
示例2: addDir
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def addDir(name, ex_link=None, params=1, mode='folder', iconImage='DefaultFolder.png', infoLabels=None, fanart=FANART,
contextmenu=None):
url = build_url({'mode': mode, 'foldername': name, 'ex_link': ex_link, 'params': params})
nofolders = ['take_stream', 'opensettings', 'enable_input', 'forceupdate', 'open_news', 'ccache', 'showalts']
folder = False if mode in nofolders else True
li = xbmcgui.ListItem(name)
if infoLabels:
li.setInfo(type="video", infoLabels=infoLabels)
li.setProperty('fanart_image', fanart)
art_keys = ['thumb', 'poster', 'banner', 'fanart', 'clearart', 'clearlogo', 'landscape', 'icon']
art = dict(zip(art_keys, [iconImage for x in art_keys]))
art['landscape'] = fanart if fanart else art['landscape']
art['fanart'] = fanart if fanart else art['landscape']
li.setArt(art)
if contextmenu:
contextMenuItems = contextmenu
li.addContextMenuItems(contextMenuItems, replaceItems=True)
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=folder)
xbmcplugin.addSortMethod(addon_handle, sortMethod=xbmcplugin.SORT_METHOD_NONE, label2Mask="%R, %Y, %P")
示例3: channeltypes
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def channeltypes(params,url,category):
logger.info("channelselector.channeltypes")
lista = getchanneltypes()
for item in lista:
addfolder(item.title,item.channel,item.action,category=item.category,thumbnailname=item.thumbnail)
if config.get_platform()=="kodi-krypton" or config.get_platform()=="kodi-leia":
import plugintools
plugintools.set_view( plugintools.TV_SHOWS )
# Label (top-right)...
import xbmcplugin
xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category="" )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
if config.get_setting("forceview")=="true":
# Confluence - Thumbnail
import xbmc
xbmc.executebuiltin("Container.SetViewMode(500)")
示例4: listchannels
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def listchannels(params,url,category):
logger.info("channelselector.listchannels")
lista = filterchannels(category)
for channel in lista:
if config.is_xbmc() and (channel.type=="xbmc" or channel.type=="generic"):
addfolder(channel.title , channel.channel , "mainlist" , channel.channel)
elif config.get_platform()=="boxee" and channel.extra!="rtmp":
addfolder(channel.title , channel.channel , "mainlist" , channel.channel)
if config.get_platform()=="kodi-krypton" or config.get_platform()=="kodi-leia":
import plugintools
plugintools.set_view( plugintools.TV_SHOWS )
# Label (top-right)...
import xbmcplugin
xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category=category )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
if config.get_setting("forceview")=="true":
# Confluence - Thumbnail
import xbmc
xbmc.executebuiltin("Container.SetViewMode(500)")
示例5: add_sort_methods
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def add_sort_methods(sort_type):
if sort_type == 'sort_nothing':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_NONE)
if sort_type == 'sort_label':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)
if sort_type == 'sort_label_ignore_folders':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL_IGNORE_FOLDERS)
if sort_type == 'sort_episodes':
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_EPISODE)
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(g.PLUGIN_HANDLE, xbmcplugin.SORT_METHOD_VIDEO_TITLE)
示例6: mainlist
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def mainlist(params,url,category):
logger.info("channelselector.mainlist")
# Verifica actualizaciones solo en el primer nivel
if config.get_platform()!="boxee":
try:
from core import updater
except ImportError:
logger.info("channelselector.mainlist No disponible modulo actualizaciones")
else:
if config.get_setting("check_for_plugin_updates") == "true":
logger.info("channelselector.mainlist Verificar actualizaciones activado")
updater.checkforupdates()
else:
logger.info("channelselector.mainlist Verificar actualizaciones desactivado")
itemlist = getmainlist("squares")
for elemento in itemlist:
logger.info("channelselector item="+elemento.tostring())
addfolder(elemento.title , elemento.channel , elemento.action , thumbnailname=elemento.thumbnail, folder=elemento.folder)
if config.get_platform()=="kodi-krypton" or config.get_platform()=="kodi-leia":
import plugintools
plugintools.set_view( plugintools.TV_SHOWS )
# Label (top-right)...
import xbmcplugin
#xbmcplugin.setPluginCategory( handle=int( sys.argv[ 1 ] ), category="" )
#xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
if config.get_setting("forceview")=="true":
# Confluence - Thumbnail
import xbmc
xbmc.executebuiltin("Container.SetViewMode(500)")
示例7: endofdirectory
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def endofdirectory(args):
# sort methods are required in library mode
xbmcplugin.addSortMethod(int(args._argv[1]), xbmcplugin.SORT_METHOD_NONE)
# let xbmc know the script is done adding items to the list
xbmcplugin.endOfDirectory(handle = int(args._argv[1]))
示例8: buildShowsList
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def buildShowsList(videos):
for chan, video_url, video_title, video_icon, infoLabels, video_mode in videos:
li = xbmcgui.ListItem(
video_title,
iconImage=video_icon,
thumbnailImage=video_icon,
path=video_url)
url = build_url({
'mode': video_mode,
'channel': chan,
'param': video_url,
'name': video_title})
if video_mode == 'play':
li.setInfo( type='Video', infoLabels=infoLabels)
li.setProperty('IsPlayable', 'true')
li.addContextMenuItems([(globalvar.LANGUAGE(33020).encode('utf-8'), 'XBMC.RunPlugin(%s?mode=dl&channel=%s¶m=%s&name=%s)' % (sys.argv[0],chan,urllib.quote_plus(video_url),urllib.quote_plus(video_title)))])
xbmcplugin.addSortMethod(addon_handle, xbmcplugin.SORT_METHOD_NONE)
xbmcplugin.setPluginCategory(addon_handle, 'episodes')
xbmcplugin.setContent(addon_handle, 'episodes')
xbmcplugin.addDirectoryItem(
handle=addon_handle,
url=url,
listitem=li,
isFolder=video_mode != 'play')
if channel == 'favourites' and param == 'unseen':
notify(globalvar.LANGUAGE(33026).encode('utf-8'), 0)
示例9: show_menu
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def show_menu():
if get_app_id() == '' or get_app_key() == '' or get_secret_key() == '':
return show_credentials_needed_menu()
listing = []
tv_list_item = xbmcgui.ListItem(label='[COLOR {0}]{1}[/COLOR]'.format(
get_color('menuItemColor'), get_translation(32031)))
tv_url = '{0}?action=categories&base=5-130'.format(_url)
listing.append((tv_url, tv_list_item, True))
live_tv_list_item = xbmcgui.ListItem(label='[COLOR {0}]{1}[/COLOR]'.format(
get_color('menuItemColor'), get_translation(32067)))
live_tv_url = '{0}?action=live'.format(_url)
listing.append((live_tv_url, live_tv_list_item, True))
radio_list_item = xbmcgui.ListItem(label='[COLOR {0}]{1}[/COLOR]'.format(
get_color('menuItemColor'), get_translation(32032)))
radio_url = '{0}?action=categories&base=5-200'.format(_url)
listing.append((radio_url, radio_list_item, True))
search_list_item = xbmcgui.ListItem(label='[COLOR {0}]{1}[/COLOR]'.format(
get_color('menuItemColor'), get_translation(32007)))
search_url = '{0}?action=search'.format(_url)
listing.append((search_url, search_list_item, True))
favourites_list_item = xbmcgui.ListItem(label='[COLOR {0}]{1}[/COLOR]'.format(
get_color('menuItemColor'), get_translation(32025)))
favourites_url = '{0}?action=favourites'.format(_url)
listing.append((favourites_url, favourites_list_item, True))
open_settings_list_item = xbmcgui.ListItem(label='[COLOR {0}]{1}[/COLOR]'.format(
get_color('menuItemColor'), get_translation(32040)))
open_settings_url = '{0}?action=settings'.format(_url)
listing.append((open_settings_url, open_settings_list_item, True))
# Add our listing to Kodi.
xbmcplugin.addDirectoryItems(_handle, listing, len(listing))
# Add a sort method for the virtual folder items (alphabetically, ignore articles)
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_NONE)
# Finish creating a virtual folder.
xbmcplugin.endOfDirectory(_handle)
示例10: show_credentials_needed_menu
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def show_credentials_needed_menu():
listing = []
missing_credentials_list_item = xbmcgui.ListItem(label=get_translation(32038))
missing_credentials_url = '{0}'.format(_url)
listing.append((missing_credentials_url, missing_credentials_list_item, True))
open_settings_list_item = xbmcgui.ListItem(label=get_translation(32039))
open_settings_url = '{0}?action=settings'.format(_url)
listing.append((open_settings_url, open_settings_list_item, True))
# Add our listing to Kodi.
xbmcplugin.addDirectoryItems(_handle, listing, len(listing))
# Add a sort method for the virtual folder items (alphabetically, ignore articles)
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_NONE)
# Finish creating a virtual folder.
xbmcplugin.endOfDirectory(_handle)
示例11: add_items_to_kodi_directory
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def add_items_to_kodi_directory(itemlist,parent_item):
logger.info("tvalacarta.platformcode.xbmctools add_items_to_kodi_directory")
pluginhandle = int( sys.argv[ 1 ] )
# Checks if channel provides context menu for items
exec "import channels."+parent_item.channel+" as channelmodule"
channel_provides_context_menu = hasattr(channelmodule, 'get_context_menu_for_item')
for item in itemlist:
# If video has no fanart, here is assigned a new one
if item.fanart=="":
channel_fanart = os.path.join( config.get_runtime_path(), 'resources', 'images', 'fanart', item.channel+'.jpg')
if os.path.exists(channel_fanart):
item.fanart = channel_fanart
else:
item.fanart = os.path.join(config.get_runtime_path(),"fanart.jpg")
# Add item to kodi directory
add_item_to_kodi_directory(item,itemlist,channel_provides_context_menu)
# Closes the XBMC directory
xbmcplugin.setPluginCategory( handle=pluginhandle, category=parent_item.category )
xbmcplugin.addSortMethod( handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE )
# Forces the view mode
if config.get_setting("forceview")=="true":
import plugintools
if parent_item.view=="list":
plugintools.set_view( plugintools.LIST )
elif parent_item.view=="programs":
plugintools.set_view( plugintools.TV_SHOWS )
elif parent_item.view=="channels" or parent_item.view=="thumbnails":
if config.get_platform()=="kodi-krypton":
plugintools.set_view( plugintools.TV_SHOWS )
else:
plugintools.set_view( plugintools.THUMBNAIL )
elif parent_item.view=="videos":
plugintools.set_view( plugintools.EPISODES )
xbmcplugin.endOfDirectory( handle=pluginhandle, succeeded=True )
示例12: build_season_listing
# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_NONE [as 別名]
def build_season_listing(self, seasons_sorted, build_url, widget_display=False):
"""Builds the season list screen for a show
Parameters
----------
seasons_sorted : :obj:`list` of :obj:`dict` of :obj:`str`
Sorted list of season entries
build_url : :obj:`fn`
Function to build the subsequent routes
Returns
-------
bool
List could be build
"""
for season in seasons_sorted:
li = xbmcgui.ListItem(label=season['text'])
# add some art to the item
li.setArt(self._generate_art_info(entry=season))
# add list item info
infos = self._generate_listitem_info(
entry=season,
li=li,
base_info={'mediatype': 'season'})
self._generate_context_menu_items(entry=season, li=li)
params = {'action': 'episode_list', 'season_id': season['id']}
if 'tvshowtitle' in infos:
title = infos.get('tvshowtitle', '').encode('utf-8')
params['tvshowtitle'] = base64.urlsafe_b64encode(title)
url = build_url(params)
xbmcplugin.addDirectoryItem(
handle=self.plugin_handle,
url=url,
listitem=li,
isFolder=True)
xbmcplugin.addSortMethod(
handle=self.plugin_handle,
sortMethod=xbmcplugin.SORT_METHOD_NONE)
xbmcplugin.addSortMethod(
handle=self.plugin_handle,
sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR)
xbmcplugin.addSortMethod(
handle=self.plugin_handle,
sortMethod=xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(
handle=self.plugin_handle,
sortMethod=xbmcplugin.SORT_METHOD_LASTPLAYED)
xbmcplugin.addSortMethod(
handle=self.plugin_handle,
sortMethod=xbmcplugin.SORT_METHOD_TITLE)
xbmcplugin.setContent(
handle=self.plugin_handle,
content=CONTENT_SEASON)
xbmcplugin.endOfDirectory(self.plugin_handle)
if not widget_display:
self.set_custom_view(VIEW_SEASON)
return True