本文整理汇总了Python中t0mm0.common.addon.Addon.get_name方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.get_name方法的具体用法?Python Addon.get_name怎么用?Python Addon.get_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t0mm0.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.get_name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_addons_that_have_favorites
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_name [as 别名]
def get_addons_that_have_favorites(self):
addons = []
sql_select = "SELECT DISTINCT addon_id FROM favorites ORDER BY addon_id"
self.dbcur.execute(sql_select)
for matchedrow in self.dbcur.fetchall():
match = dict(matchedrow)
try:
tmp_addon_id = match['addon_id']
tmp_addon = Addon(tmp_addon_id)
tmp_addon_name = tmp_addon.get_name()
tmp_addon_img = tmp_addon.get_icon()
tmp_addon_fanart = tmp_addon.get_fanart()
except:
tmp_addon_name = tmp_addon_id
tmp_addon_img = ''
tmp_addon_fanart = ''
pass
tmp_addon_dtl = {'title' : tmp_addon_name, 'id' : tmp_addon_id, 'img':tmp_addon_img, 'fanart':tmp_addon_fanart}
addons.append(tmp_addon_dtl)
return addons
示例2: add_my_fav_directory
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_name [as 别名]
def add_my_fav_directory(self, title='Favorites', img='', fanart='', item_mode='main'):
if not self.sys_argv:
common.addon.log_error('-' + HELPER + '- -' +'sys.argv not passed in Favorites __init__(); Favorites directory will not be created.')
return
try:
tmp_addon_id = 'plugin.video.favorites'
tmp_addon = Addon(tmp_addon_id)
tmp_addon_name = tmp_addon.get_name()
except:
common.addon.log_error('-' + HELPER + '- -' +'Favorites video plugin not installed; Favorites directory will not be created.')
common.notify(self.addon_id, 'small', ' - My Favorites video addon required', 'Please install My Favorites video addon from The ONE\'s XBMC Addons Repository.', '10000')
return
listitem = xbmcgui.ListItem(title, iconImage=img, thumbnailImage=img)
listitem.setProperty('fanart_image', fanart)
uni_fav = {
'uni_fav_addon_id': self.addon_id,
'uni_fav_mode': 'display',
'uni_fav_item_mode': item_mode
}
params = self._build_params( {'mode':'browse', 'addon_id':self.addon_id, 'local':'true', 'item_mode':item_mode} )
xbmcplugin.addDirectoryItem(handle=int(self.sys_argv[1]),url='plugin://plugin.video.favorites/'+params,isFolder=True,listitem=listitem)
示例3: notify
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_name [as 别名]
def notify(addon_id, typeq, title, message, times, line2='', line3=''):
addon_tmp = Addon(addon_id)
if title == '' :
title='[B]' + addon_tmp.get_name() + '[/B]'
if typeq == 'small':
if times == '':
times='5000'
smallicon= addon_tmp.get_icon()
xbmc.executebuiltin("XBMC.Notification("+title+","+message+","+times+","+smallicon+")")
elif typeq == 'big':
dialog = xbmcgui.Dialog()
dialog.ok(' '+title+' ', ' '+message+' ', line2, line3)
else:
dialog = xbmcgui.Dialog()
dialog.ok(' '+title+' ', ' '+message+' ')
示例4: add_my_history_directory
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import get_name [as 别名]
def add_my_history_directory(self, title='Watch History', img='', fanart=''):
if not self.sys_argv:
common.addon.log_error('-' + HELPER + '- -' +'sys.argv not passed in WatchHistory __init__(); Watch History directory will not be created.')
return
try:
tmp_addon_id = 'plugin.video.watchhistory'
tmp_addon = Addon(tmp_addon_id)
tmp_addon_name = tmp_addon.get_name()
except:
common.addon.log_error('-' + HELPER + '- -' +'Watch History video plugin not installed; Watch History directory will not be created.')
common.notify(self.addon_id, 'small', ' - Watch History video addon required', 'Please install Watch History video addon from The ONE\'s XBMC Addons Repository.', '10000')
return
listitem = xbmcgui.ListItem(title, iconImage=img, thumbnailImage=img)
listitem.setProperty('fanart_image', fanart)
params = '?' + common.dict_to_paramstr( {'mode':'browse', 'addon_id':self.addon_id, 'local':'true'} )
xbmcplugin.addDirectoryItem(handle=int(self.sys_argv[1]),url='plugin://plugin.video.watchhistory/'+params,isFolder=True,listitem=listitem)