本文整理汇总了Python中resources.lib.settings.Settings.isServiceEnabled方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.isServiceEnabled方法的具体用法?Python Settings.isServiceEnabled怎么用?Python Settings.isServiceEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resources.lib.settings.Settings
的用法示例。
在下文中一共展示了Settings.isServiceEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: hasVideoExtras
# 需要导入模块: from resources.lib.settings import Settings [as 别名]
# 或者: from resources.lib.settings.Settings import isServiceEnabled [as 别名]
def hasVideoExtras(self, target, dbid, file, title=None):
# If the service is on, then we can just check to see if the overlay image exists
if Settings.isServiceEnabled():
# Get the path where the file exists
rootPath = os_path_join(PROFILE_DIR, target)
if not dir_exists(rootPath):
# Directory does not exist yet, so can't have extras
return False
# Generate the name of the file that the overlay will be copied to
targetFile = os_path_join(rootPath, ("%d.png" % dbid))
if xbmcvfs.exists(targetFile):
return True
# Otherwise, need to do the lookup the old fashioned way of looking for the
# extras files on the file system (This is much slower)
else:
videoExtras = VideoExtrasBase(file, target, title)
# We are only checking for existence of extras, no need for fanart
firstExtraFile = videoExtras.findExtras(True)
del videoExtras
if firstExtraFile:
log("MenuNavigator: Extras found for (%d) %s" % (dbid, file))
return True
return False
示例2: os_path_join
# 需要导入模块: from resources.lib.settings import Settings [as 别名]
# 或者: from resources.lib.settings.Settings import isServiceEnabled [as 别名]
if ADDON.getSetting('listImage') in [None, '']:
skinExtrasList = os_path_join(RES_DIR, "skins")
skinExtrasList = os_path_join(skinExtrasList, "icons")
skinExtrasList = os_path_join(skinExtrasList, "list1.png")
ADDON.setSetting('listImage', skinExtrasList)
# Check the YouTube settings are correct, we will automatically disable the
# option if the YouTube addon is not installed
checkYouTubeSettings()
# Check the Vimeo settings are correct, we will automatically disable the
# option if the Vimeo addon is not installed
checkVimeoSettings()
# Make sure that the service option is enabled
if Settings.isServiceEnabled():
try:
# Construct the service class
service = VideoExtrasService()
# Refresh the caches
service.cacheAllExtras()
del service
except:
log("VideoExtrasService: %s" % traceback.format_exc(), xbmc.LOGERROR)
else:
# Service not enabled
log("VideoExtrasService: Service disabled in settings")
# Clean any cached extras
CacheCleanup.removeAllCachedFiles()