当前位置: 首页>>代码示例>>Python>>正文


Python Settings.isServiceEnabled方法代码示例

本文整理汇总了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
开发者ID:croneter,项目名称:script.videoextras,代码行数:28,代码来源:plugin.py

示例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()
开发者ID:croneter,项目名称:script.videoextras,代码行数:32,代码来源:service.py


注:本文中的resources.lib.settings.Settings.isServiceEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。