本文整理汇总了Python中resources.utility.generic_utility.get_string函数的典型用法代码示例。如果您正苦于以下问题:Python get_string函数的具体用法?Python get_string怎么用?Python get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: cookies
def cookies():
if xbmcvfs.exists(generic_utility.cookies_file()):
xbmcvfs.delete(generic_utility.cookies_file())
generic_utility.notification(generic_utility.get_string(30301))
if xbmcvfs.exists(generic_utility.headers_file()):
xbmcvfs.delete(generic_utility.headers_file())
generic_utility.notification(generic_utility.get_string(30302))
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:8,代码来源:delete.py
示例2: index
def index():
add.directory(generic_utility.get_string(30100), '', 'main', '', 'movie', login_context=True)
add.directory(generic_utility.get_string(30101), '', 'main', '', 'tv', login_context=True)
add.directory(generic_utility.get_string(30102), '', 'wi_home', '', 'both', login_context=True)
if not generic_utility.get_setting('single_profile') == 'true':
add.item(
generic_utility.get_string(30103) + ' - [COLOR FF8E0000]' + generic_utility.get_setting('profile_name') + '[/COLOR]',
'choose_profile', login_context=True)
xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:9,代码来源:general.py
示例3: addon
def addon():
dialog = xbmcgui.Dialog()
if dialog.yesno(generic_utility.addon_name + ':', generic_utility.get_string(30307)):
try:
xbmcvfs.rmdir(generic_utility.data_dir(), force=True)
generic_utility.log('Addon userdata folder deleted.')
generic_utility.notification(generic_utility.get_string(30308))
except Exception:
pass
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:9,代码来源:delete.py
示例4: main
def main(video_type):
add.directory(generic_utility.get_string(30105), '', 'list_viewing_activity', '', video_type)
add_dynamic_lists(video_type)
if video_type == 'tv':
add.directory(generic_utility.get_string(30107), 'genre?83', 'list_videos', '', video_type)
add.directory(generic_utility.get_string(30108), '', 'list_genres', '', video_type)
else:
add.directory(generic_utility.get_string(30108), '', 'list_genres', '', video_type)
add.directory(generic_utility.get_string(30109), '', 'search', '', video_type)
xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:11,代码来源:general.py
示例5: cache
def cache():
try:
xbmcvfs.rmdir(generic_utility.cache_dir(), force=True)
generic_utility.log('Cache folder deleted.')
generic_utility.notification(generic_utility.get_string(30309))
except Exception:
pass
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:7,代码来源:delete.py
示例6: directory
def directory(name, url, mode, thumb, type='', context_enable=True, login_context = False):
entries = []
name = generic_utility.unescape(name)
u = sys.argv[0]
u += '?url=' + urllib.quote_plus(url)
u += '&mode=' + mode
u += '&thumb=' + urllib.quote_plus(thumb)
u += '&type=' + type
list_item = xbmcgui.ListItem(name)
list_item.setArt({'icon': 'DefaultTVShows.png', 'thumb': thumb})
list_item.setInfo(type='video', infoLabels={'title': name})
if "/my-list" in url:
entries.append(
(generic_utility.get_string(30150), 'RunPlugin(plugin://%s/?mode=add_my_list_to_library)' % generic_utility.addon_id))
list_item.setProperty('fanart_image', generic_utility.addon_fanart())
if context_enable:
if login_context == True:
entries.append(('Relogin',
'RunPlugin(plugin://%s/?mode=relogin)' % (
generic_utility.addon_id)))
list_item.addContextMenuItems(entries)
else:
list_item.addContextMenuItems([], replaceItems=True)
directory_item = xbmcplugin.addDirectoryItem(handle=plugin_handle, url=u, listitem=list_item, isFolder=True)
return directory_item
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:26,代码来源:add.py
示例7: read_lists
def read_lists(falkor_cache):
mylist_id = extract_mylist_id(falkor_cache)
lists = falkor_cache['lists']
lists = filter_size(lists)
rets = []
videos=[]
list_contains_mylist = False
for list_key in lists:
list = lists[list_key]
list = filter_size(list)
if 'displayName' in list:
if list_key == mylist_id:
list_contains_mylist = True
display_name = unicode(list['displayName']['value'])
ret = {'id': list_key, 'name': display_name}
rets.append(ret)
if not list_contains_mylist:
ret = {'id': mylist_id, 'name': generic_utility.get_string(30104)}
rets.append(ret)
return rets
开发者ID:jochenberger,项目名称:plugin.video.flix2kodi,代码行数:25,代码来源:general.py
示例8: add_videos_to_directory
def add_videos_to_directory(loading_progress, run_as_widget, video_metadatas, video_type, page = None, url=None, viewing_activity = False):
removable = url != None and 'mylist' in url
if not viewing_activity:
sorted_video_metadata = sorted(video_metadatas, key=lambda t: t['title'], reverse = viewing_activity)
else:
sorted_video_metadata = video_metadatas
allowed_types = calc_allowed_types(video_type, viewing_activity)
filtered_video_metadata = []
for video_metadata in sorted_video_metadata:
if video_metadata['type'] in allowed_types:
filtered_video_metadata.append(video_metadata)
add.videos(filtered_video_metadata, removable, viewing_activity=viewing_activity)
items_per_page = int(generic_utility.get_setting('items_per_page'))
if (not url or 'list_viewing_activity' not in url) and len(video_metadatas) == items_per_page:
add.add_next_item('zzz[Next]zzz', page + 1, url, video_type, 'list_videos', '')
if len(video_metadatas) == 0:
generic_utility.notification(generic_utility.get_string(30306))
if not viewing_activity:
add_sort_methods()
开发者ID:jduda,项目名称:plugin.video.flix2kodi,代码行数:26,代码来源:list.py
示例9: show_loading_progress
def show_loading_progress(run_as_widget):
loading_progress = None
if not run_as_widget:
loading_progress = xbmcgui.DialogProgress()
loading_progress.create('Netflix', generic_utility.get_string(30205) + '...')
generic_utility.progress_window(loading_progress, 0, '...')
return loading_progress
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:7,代码来源:list.py
示例10: read_browser
def read_browser(self):
self.browser = generic_utility.get_setting('browser')
if self.browser not in(BROWSER_CHROME, BROWSER_CHROME_LAUNCHER, BROWSER_EDGE, BROWSER_INTERNET_EXPLORER, BROWSER_SAFARI, BROWSER_CHROMIUM, BROWSER_ANDROID):
generic_utility.notification(generic_utility.get_string(50001))
xbmc.sleep(2000)
self.valid_browser = False
generic_utility.open_setting()
self.valid_browser = True
开发者ID:fkmclane,项目名称:plugin.video.flix2kodi,代码行数:8,代码来源:play.py
示例11: add_context_menu_movie
def add_context_menu_movie(entries, removable, title, type, video_id, year):
entries.append((
generic_utility.get_string(30153), 'RunPlugin(plugin://%s/?mode=play_trailer&url=%s&type=%s)' % (
generic_utility.addon_id, urllib.quote_plus(generic_utility.encode(title)), type)))
entries.append((generic_utility.get_string(30156),
'Container.Update(plugin://%s/?mode=list_videos&url=%s&type=movie)' % (
generic_utility.addon_id, urllib.quote_plus(
generic_utility.main_url + 'WiMovie/' + video_id))))
entries.append(
(generic_utility.get_string(30157), 'Container.Update(plugin://%s/?mode=list_videos&url=%s&type=tv)' % (
generic_utility.addon_id, urllib.quote_plus(generic_utility.main_url + 'WiMovie/' + video_id))))
if removable:
entries.append((generic_utility.get_string(30154), 'RunPlugin(plugin://%s/?mode=remove_from_queue&url=%s)' % (
generic_utility.addon_id, urllib.quote_plus(video_id))))
else:
entries.append((generic_utility.get_string(30155), 'RunPlugin(plugin://%s/?mode=add_to_queue&url=%s)' % (
generic_utility.addon_id, urllib.quote_plus(video_id))))
title_utf8 = title.strip() + ' (' + str(year) + ')'
title = urllib.quote_plus(title_utf8.encode('utf-8'))
movie_dir = library.get_movie_dir(title_utf8)[0]
if xbmcvfs.exists(movie_dir + os.sep) == False:
entries.append((generic_utility.get_string(30150),
'RunPlugin(plugin://%s/?mode=add_movie_to_library&url=%s&name=%s)' % (
generic_utility.addon_id, urllib.quote_plus(video_id),
title)))
else:
entries.append((generic_utility.get_string(301501),
'RunPlugin(plugin://%s/?mode=remove_movie_from_library&url=&name=%s)' % (
generic_utility.addon_id, title)))
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:29,代码来源:add.py
示例12: __init__
def __init__(self):
global addon_path
self.read_browser()
self.strActionInfo = xbmcgui.ControlLabel(180, 60, 1200, 400, '', 'font14', '0xFFBBBBFF')
self.addControl(self.strActionInfo)
self.strActionInfo.setLabel(generic_utility.get_string(50005))
addon_path = xbmcaddon.Addon().getAddonInfo("path")
开发者ID:fkmclane,项目名称:plugin.video.flix2kodi,代码行数:9,代码来源:play.py
示例13: main
def main(video_type):
add.directory(generic_utility.get_string(30105), '', 'list_viewing_activity', '', video_type)
if video_type == 'show':
add.directory(generic_utility.get_string(30107), 'genre?83', 'list_videos', '', video_type)
add.directory(generic_utility.get_string(30108), '', 'list_genres', '', video_type)
elif video_type == 'movie':
add.directory(generic_utility.get_string(30108), '', 'list_genres', '', video_type)
elif video_type == 'dynamic':
add_dynamic_lists()
if video_type != 'dynamic':
root_list = lolomos.get_root_list()
mylist = lolomos.get_mylist(root_list)
add.directory(child('displayName', mylist[1]), 'list?&mylist', 'list_videos', '', video_type)
add.directory(generic_utility.get_string(30109), '', 'search', '', video_type)
xbmcplugin.endOfDirectory(plugin_handle, cacheToDisc=False)
开发者ID:jduda,项目名称:plugin.video.flix2kodi,代码行数:19,代码来源:general.py
示例14: trailer
def trailer(video_type, title):
content = search.tmdb(video_type, title)
if content['total_results'] > 0:
content = content['results'][0]
tmdb_id = content['id']
content = search.trailer(video_type, tmdb_id)
else:
generic_utility.notification(generic_utility.get_string(30305))
content = None
return content
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:10,代码来源:get.py
示例15: login
def login():
if not test:
login_progress = xbmcgui.DialogProgress()
login_progress.create('Netflix', generic_utility.get_string(30200) + '...')
generic_utility.progress_window(login_progress, 25, generic_utility.get_string(30201))
content = connect.load_netflix_site(generic_utility.main_url + 'Login', new_session=True, login_process=True)
if not 'Sorry, Netflix ' in content:
match = re.compile('locale: "(.+?)"', re.DOTALL|re.UNICODE).findall(content)
locale = None
if(len(match)) == 0:
match = re.compile('"pageName":"login","locale":"(.+?)"', re.DOTALL|re.UNICODE).findall(content)
if(len(match)) == 0:
generic_utility.error('Cannot find locale on page. content: '+content)
login_url = 'Login'
else:
locale = match[0]
login_url = 'Login?locale=' + locale
else:
locale = match[0]
login_url = 'Login?locale=' + locale
generic_utility.set_setting('language', locale)
post_data = {'authURL': generic_utility.get_setting('authorization_url'), 'email': generic_utility.get_setting('username'),
'password': generic_utility.get_setting('password'), 'RememberMe': 'on'}
if not test:
generic_utility.progress_window(login_progress, 50, generic_utility.get_string(30202))
content = connect.load_netflix_site(
generic_utility.main_url + login_url,
post=post_data, login_process=True)
if 'id="page-LOGIN"' in content:
if not test:
generic_utility.notification(generic_utility.get_string(30303))
return False
parse_data_set_cookies(content)
if not test:
generic_utility.progress_window(login_progress, 75, generic_utility.get_string(30203))
profile_selection()
if login_progress:
if not test:
if not generic_utility.progress_window(login_progress, 100, generic_utility.get_string(30204)):
return False
xbmc.sleep(500)
login_progress.close()
return True
else:
if not test:
generic_utility.notification(generic_utility.get_string(30300))
if login_progress:
login_progress.close()
return False
开发者ID:jduda,项目名称:plugin.video.flix2kodi,代码行数:57,代码来源:login.py
示例16: trailer
def trailer(video_type, title):
import search
content = search.tmdb(video_type, title)
if content["total_results"] > 0:
content = content["results"][0]
tmdb_id = content["id"]
content = search.trailer(video_type, tmdb_id)
else:
generic_utility.notification(generic_utility.get_string(30305))
content = None
return content
开发者ID:moranshe,项目名称:plugin.video.flix4kodi,代码行数:12,代码来源:get.py
示例17: season
def season(item):
entries = []
u = sys.argv[0]
u += '?url=' + urllib.quote_plus(unicode(item.get("season")))
u += '&mode=list_episodes'
u += '&series_id=' + urllib.quote_plus(item.get("series_id"))
if generic_utility.get_setting('use_tmdb') == 'true':
extended_info = get.extended_artwork(item.get("tvshowtitle"),item.get("tvshowyear"),"show",item.get("series_id"))
else:
extended_info = {}
list_item = xbmcgui.ListItem(item.get("name"))
artwork = {
'icon': 'DefaultTVShows.png',
'thumb': extended_info.get("poster", item.get("seriesthumb","")),
'landscape': extended_info.get("landscape",item.get("seriesthumb","")),
'poster': extended_info.get("poster",""),
'clearlogo': extended_info.get("clearlogo",""),
'clearart': extended_info.get("clearart",""),
'fanart': extended_info.get("fanart",""),
'characterart': extended_info.get("characterart",""),
'discart': extended_info.get("discart",""),
'banner': extended_info.get("banner","")
}
list_item.setArt(artwork)
list_item.setInfo(type='video',infoLabels={
'title': item.get("name",""),
'year': item.get("year"),
'playcount': item.get("playcount"),
'tvshowtitle':item.get("tvshowtitle"),
'castandrole': eval(extended_info.get("castandrole","[]")),
'trailer': extended_info.get("trailer",""),
'genre': extended_info.get("genre",""),
'studio': extended_info.get("studio",""),
'plot': extended_info.get("plot",item.get("description","")),
'plotoutline': item.get("description",""),
'director': extended_info.get("director",""),
'writer': extended_info.get("writer",""),
'rating': float(extended_info.get("rating","0")),
})
list_item.setProperty("totalepisodes", str(item.get("total_episodes","")))
list_item.setProperty("watchedepisodes", str(item.get("watched_episodes","")))
list_item.setProperty("unwatchedepisodes", str(item.get("unwatched_episodes","")))
entries.append((generic_utility.get_string(30150),
'RunPlugin(plugin://%s/?mode=add_series_to_library&url=%s&name=%s&series_id=%s)' % (
generic_utility.addon_id, urllib.quote_plus(unicode(item.get("season"))),
urllib.quote_plus(generic_utility.encode(item.get("tvshowtitle").strip())),
item.get("series_id"))))
list_item.addContextMenuItems(entries)
directory_item = xbmcplugin.addDirectoryItem(handle=plugin_handle, url=u, listitem=list_item, isFolder=True)
return directory_item
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:53,代码来源:add.py
示例18: add_context_menu_show
def add_context_menu_show(entries, removable, thumb_url, title, video_id):
if generic_utility.get_setting('browse_tv_shows') == 'true':
entries.append((generic_utility.get_string(30151),
'Container.Update(plugin://%s/?mode=play_video_main&url=%s&thumb=%s)' % (
generic_utility.addon_id, urllib.quote_plus(video_id), urllib.quote_plus(thumb_url))))
else:
entries.append((generic_utility.get_string(30152),
'Container.Update(plugin://%s/?mode=list_seasons&url=%s&thumb=%s)' % (
generic_utility.addon_id, urllib.quote_plus(video_id), urllib.quote_plus(thumb_url))))
if removable:
entries.append((generic_utility.get_string(30154), 'RunPlugin(plugin://%s/?mode=remove_from_queue&url=%s)' % (
generic_utility.addon_id, urllib.quote_plus(video_id))))
else:
entries.append((generic_utility.get_string(30155), 'RunPlugin(plugin://%s/?mode=add_to_queue&url=%s)' % (
generic_utility.addon_id, urllib.quote_plus(video_id))))
series_dir = library.get_series_dir(title.strip())
# generic_utility.log('series-dir: '+series_dir)
if xbmcvfs.exists(series_dir + os.sep) == False:
entries.append((generic_utility.get_string(30150),
'RunPlugin(plugin://%s/?mode=add_series_to_library&url=&name=%s&series_id=%s)' % (
generic_utility.addon_id, urllib.quote_plus(generic_utility.encode(title.strip())),
urllib.quote_plus(video_id))))
else:
entries.append((generic_utility.get_string(301501),
'RunPlugin(plugin://%s/?mode=remove_series_from_library&url=&name=%s)' % (
generic_utility.addon_id, urllib.quote_plus(generic_utility.encode(title.strip())))))
开发者ID:jwhite,项目名称:plugin.video.flix2kodi,代码行数:26,代码来源:add.py
示例19: viewing_activity
def viewing_activity(video_type, run_as_widget=False):
loading_progress = show_loading_progress(run_as_widget)
xbmcplugin.setContent(plugin_handle, 'movies')
metadata = get.viewing_activity_matches(video_type)
if len(metadata) > 0:
add_videos_to_directory(loading_progress, run_as_widget, metadata, video_type, viewing_activity=True)
else:
generic_utility.notification(generic_utility.get_string(30306))
if generic_utility.get_setting('force_view') and not run_as_widget:
xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_activity') + ')')
xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:13,代码来源:list.py
示例20: add_next_item
def add_next_item(page, url, video_type, mode):
name = generic_utility.get_string(30110)
u = sys.argv[0]
u += '?url=' + urllib.quote_plus(url)
u += '&mode=' + mode
u += '&type=' + video_type
u += '&page=' + str(page)
u += '&name=' + urllib.quote_plus(generic_utility.encode(name))
liz=xbmcgui.ListItem(unicode(name), iconImage="DefaultFolder.png")
liz.setInfo( type="Video", infoLabels={ "Title": name, "sorttitle": "zzzzzzz"})
liz.setArt( { "thumb": generic_utility.addon_handle.getAddonInfo('icon'), "fanart":generic_utility.addon_handle.getAddonInfo('fanart') })
liz.setProperty('IsPlayable', 'false');
ok=xbmcplugin.addDirectoryItem(handle=plugin_handle,url=u,listitem=liz,isFolder=True)
return ok
开发者ID:badcrc,项目名称:plugin.video.flix2kodi,代码行数:14,代码来源:add.py
注:本文中的resources.utility.generic_utility.get_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论