本文整理汇总了Python中StorageServer.StorageServer方法的典型用法代码示例。如果您正苦于以下问题:Python StorageServer.StorageServer方法的具体用法?Python StorageServer.StorageServer怎么用?Python StorageServer.StorageServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StorageServer
的用法示例。
在下文中一共展示了StorageServer.StorageServer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import StorageServer [as 别名]
# 或者: from StorageServer import StorageServer [as 别名]
def __init__(self, provider, settings, addon):
xbmcprovider.XBMCMultiResolverContentProvider.__init__(
self, provider, settings, addon)
provider.parent = self
self.dialog = xbmcgui.DialogProgress()
try:
import StorageServer
self.cache = StorageServer.StorageServer("Downloader")
except:
import storageserverdummy as StorageServer
self.cache = StorageServer.StorageServer("Downloader")
示例2: __init__
# 需要导入模块: import StorageServer [as 别名]
# 或者: from StorageServer import StorageServer [as 别名]
def __init__(self, database="whatever"):
self.cache = StorageServer.StorageServer(database, 24) # (Your plugin name, Cache time in hours)
示例3: run
# 需要导入模块: import StorageServer [as 别名]
# 或者: from StorageServer import StorageServer [as 别名]
def run():
sys.path = [settings.getAddonInfo('path') + "/lib"] + sys.path
import StorageServer
s = StorageServer.StorageServer(False)
print " StorageServer Module loaded RUN"
print s.plugin + " Starting server"
s.run()
return True
示例4: __init__
# 需要导入模块: import StorageServer [as 别名]
# 或者: from StorageServer import StorageServer [as 别名]
def __init__(self):
self.cache = StorageServer.StorageServer("mrknowfilm")
示例5: Search
# 需要导入模块: import StorageServer [as 别名]
# 或者: from StorageServer import StorageServer [as 别名]
def Search(item):
"""Called when subtitle download is requested from XBMC."""
log(u'item = %s' % pformat(item))
# Do what's needed to get the list of subtitles from service site
# use item["some_property"] that was set earlier.
# Once done, set xbmcgui.ListItem() below and pass it to
# xbmcplugin.addDirectoryItem()
file_original_path = item['file_original_path']
if item['manual_search']:
searchstring = unquote(item['manual_search_string'])
elif item['tvshow']:
searchstring = build_tvshow_searchstring(item)
else:
searchstring = '%s%s' % (item['title'], ' (%s)' % item['year'].strip('()') if item.get('year') else '')
log(u"Search string = %s" % searchstring)
cache_ttl_value = __addon__.getSetting('cache_ttl')
try:
cache_ttl = int(cache_ttl_value)
except Exception:
cache_ttl = 0
if cache_ttl:
cache = StorageServer.StorageServer('service.subtitles.subdivx', cache_ttl / 60.0)
subs_list = cache.cacheFunction(get_all_subs, searchstring, 'es', file_original_path)
else:
subs_list = get_all_subs(searchstring, 'es', file_original_path)
compute_ratings(subs_list)
for sub in subs_list:
append_subtitle(sub, file_original_path)