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


Python Settings.isCustomPathEnabled方法代码示例

本文整理汇总了Python中resources.lib.settings.Settings.isCustomPathEnabled方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.isCustomPathEnabled方法的具体用法?Python Settings.isCustomPathEnabled怎么用?Python Settings.isCustomPathEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在resources.lib.settings.Settings的用法示例。


在下文中一共展示了Settings.isCustomPathEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getPathForVideoItem

# 需要导入模块: from resources.lib.settings import Settings [as 别名]
# 或者: from resources.lib.settings.Settings import isCustomPathEnabled [as 别名]
    def getPathForVideoItem(self, videoItem):
        path = ""
        # Get the path where the theme should be stored
        if Settings.isCustomPathEnabled():
            path = os_path_join(Settings.getCustomPath(), normalize_string(videoItem['title']))
        else:
            path = videoItem['file']
            # Handle stacked files that have a custom file name format
            if path.startswith("stack://"):
                path = path.replace("stack://", "").split(" , ", 1)[0]
            # Need to remove the filename from the end  as we just want the directory
            fileExt = os.path.splitext(path)[1]
            # If this is a file, then get it's parent directory
            if fileExt is not None and fileExt != "":
                path = os_path_split(path)[0]

        return path
开发者ID:kodibrasil,项目名称:KodiBrasil,代码行数:19,代码来源:plugin.py

示例2: len

# 需要导入模块: from resources.lib.settings import Settings [as 别名]
# 或者: from resources.lib.settings.Settings import isCustomPathEnabled [as 别名]
    try:
        if len(sys.argv) > 2:
            # get the type of operation
            log("Operation = %s" % sys.argv[1])

            # Check to make sure that there was actually some data in the second argument
            # it's possible that a skin has sent us an empty string
            if (sys.argv[2] is None) or (len(sys.argv[2]) < 1):
                log("VideoExtras: Called with empty final argument", xbmc.LOGERROR)
            else:
                # Load the details of the current source of the extras
                SourceDetails.forceLoadDetails()

                # handle the plugins that VideoExtras supports
                forceExtrasSupport = False
                if ("plugin.video.emby" in sys.argv[2]) and Settings.isCustomPathEnabled():
                    forceExtrasSupport = True

                # Make sure we are not passed a plugin path
                if ("plugin://" in sys.argv[2]) and not forceExtrasSupport:
                    if sys.argv[1] == "check":
                        xbmcgui.Window(12003).setProperty("HideVideoExtrasButton", "true")
                else:
                    # Create the extras class that deals with any extras request
                    videoExtras = VideoExtras(sys.argv[2])

                    # We are either running the command or just checking for existence
                    if sys.argv[1] == "check":
                        videoExtras.checkButtonEnabled()
                    else:
                        # Check if the use database setting is enabled
开发者ID:croneter,项目名称:script.videoextras,代码行数:33,代码来源:default.py


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