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


Python Settings.getXbmcMajorVersion方法代码示例

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


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

示例1: isMusicVideoTitles

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getXbmcMajorVersion [as 别名]
 def isMusicVideoTitles(currentPath=None):
     folderPathId = "videodb://3/2/"
     # The ID for the TV Show Title changed in Gotham
     if Settings.getXbmcMajorVersion() > 12:
         folderPathId = "videodb://musicvideos/"
     if currentPath is None:
         return xbmc.getInfoLabel("container.folderpath") == folderPathId
     else:
         return currentPath == folderPathId
开发者ID:nspierbundel,项目名称:OpenELEC.tv,代码行数:11,代码来源:tvtunes_backend.py

示例2: isTv

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getXbmcMajorVersion [as 别名]
    def isTv():
        if xbmc.getCondVisibility("Container.Content(tvshows)"):
            return True
        if xbmc.getCondVisibility("Container.Content(Seasons)"):
            return True
        if xbmc.getCondVisibility("Container.Content(Episodes)"):
            return True

        folderPathId = "videodb://2/2/"
        # The ID for the TV Show Title changed in Gotham
        if Settings.getXbmcMajorVersion() > 12:
            folderPathId = "videodb://tvshows/titles/"
        if xbmc.getInfoLabel("container.folderpath") == folderPathId:
            return True  # TvShowTitles

        return False
开发者ID:nspierbundel,项目名称:OpenELEC.tv,代码行数:18,代码来源:tvtunes_scraper.py

示例3: log

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getXbmcMajorVersion [as 别名]
        # no params passed
        params = {}

    log("params %s" % params)

    if params.get("backend", False):
        xbmc.executebuiltin('XBMC.RunScript(%s)' % (os.path.join(__resource__, "tvtunes_backend.py")))

    elif params.get("mode", False) == "solo":
        xbmc.executebuiltin('XBMC.RunScript(%s)' % (os.path.join(__resource__, "tvtunes_scraper.py")))

    else:
        # Close any open dialogs
        xbmc.executebuiltin("Dialog.Close(all, true)", True)

        if Settings.getXbmcMajorVersion() > 12:
            log("TvTunes: Running as Addon/Plugin")
            xbmc.executebuiltin("RunAddon(script.tvtunes)")
        else:
            log("TvTunes: Navigating to Plugin")
            # Default to the plugin method
            xbmc.executebuiltin("xbmc.ActivateWindow(Video, addons://sources/video/)", True)

            # It is a bit hacky, but the only way I can get it to work
            # After loading the plugin screen, navigate to the TvTunes entry and select it
            maxChecks = 100
            selectedTitle = None
            while selectedTitle != 'TvTunes' and maxChecks > 0:
                maxChecks = maxChecks - 1
                json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Input.Up", "params": { }, "id": 1}')
                json_query = unicode(json_query, 'utf-8', errors='ignore')
开发者ID:nspierbundel,项目名称:OpenELEC.tv,代码行数:33,代码来源:default.py

示例4: run

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getXbmcMajorVersion [as 别名]
    def run(self):
        try:
            # Before we actually start playing something, make sure it is OK
            # to run, need to ensure there are not multiple copies running
            if not TvTunesStatus.isOkToRun():
                return

            while (not self._stop):
                # Check the forced TV Tunes status at the start of the loop, if this is True
                # then we don't want to stop themes until the next iteration, this stops the case
                # where some checks are done and the value changes part was through a single
                # loop iteration
                isForcedTvTunesContinue = WindowShowing.isTvTunesOverrideContinuePlaying()

                # If shutdown is in progress, stop quickly (no fade out)
                if WindowShowing.isShutdownMenu() or xbmc.abortRequested:
                    self.stop()
                    break

                # We only stop looping and exit this script if we leave the Video library
                # We get called when we enter the library, and the only times we will end
                # will be if:
                # 1) A Video is selected to play
                # 2) We exit to the main menu away from the video view
                if (not WindowShowing.isVideoLibrary()) or WindowShowing.isScreensaver() or Settings.isTimout():
                    log("TunesBackend: Video Library no longer visible")
                    # End playing cleanly (including any fade out) and then stop everything
                    if TvTunesStatus.isAlive():
                        self.themePlayer.endPlaying()
                    self.stop()

                    # It may be possible that we stopped for the screen-saver about to kick in
                    # If we are using Gotham or higher, it is possible for us to re-kick off the
                    # screen-saver, otherwise the action of us stopping the theme will reset the
                    # timeout and the user will have to wait longer
                    if Settings.isTimout() and (Settings.getXbmcMajorVersion() > 12):
                        xbmc.executebuiltin("xbmc.ActivateScreensaver", True)
                    break

                # There is a valid page selected and there is currently nothing playing
                if self.isPlayingZone() and not WindowShowing.isTvTunesOverrideContinuePrevious():
                    newThemes = self.getThemes()
                    if self.newThemeFiles != newThemes:
                        self.newThemeFiles = newThemes

                # Check if the file path has changed, if so there is a new file to play
                if self.newThemeFiles != self.oldThemeFiles and self.newThemeFiles.hasThemes():
                    log("TunesBackend: old path: %s" % self.oldThemeFiles.getPath())
                    log("TunesBackend: new path: %s" % self.newThemeFiles.getPath())
                    if self.start_playing():
                        self.oldThemeFiles = self.newThemeFiles

                # There is no theme at this location, so make sure we are stopped
                if not self.newThemeFiles.hasThemes() and self.themePlayer.isPlayingAudio() and TvTunesStatus.isAlive():
                    self.themePlayer.endPlaying()
                    self.oldThemeFiles.clear()
                    self.prevThemeFiles.clear()
                    self.delayedStart.clear()
                    TvTunesStatus.setAliveState(False)

                # This will occur when a theme has stopped playing, maybe is is not set to loop
                if TvTunesStatus.isAlive() and not self.themePlayer.isPlayingAudio():
                    log("TunesBackend: playing ends")
                    self.themePlayer.restoreSettings()
                    TvTunesStatus.setAliveState(False)

                # This is the case where the user has moved from within an area where the themes
                # to an area where the theme is no longer played, so it will trigger a stop and
                # reset everything to highlight that nothing is playing
                # Note: TvTunes is still running in this case, just not playing a theme
                if (not self.isPlayingZone()) and (not isForcedTvTunesContinue):
                    self.newThemeFiles.clear()
                    self.oldThemeFiles.clear()
                    self.prevThemeFiles.clear()
                    self.delayedStart.clear()
                    if self.themePlayer.isPlaying() and TvTunesStatus.isAlive():
                        log("TunesBackend: end playing")
                        self.themePlayer.endPlaying()
                    TvTunesStatus.setAliveState(False)

                self.themePlayer.checkEnding()

                # Wait a little before starting the check again
                xbmc.sleep(200)
        except:
            log("TunesBackend: %s" % traceback.format_exc())
            self.stop()
开发者ID:nspierbundel,项目名称:OpenELEC.tv,代码行数:89,代码来源:tvtunes_backend.py

示例5: isMovieSet

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getXbmcMajorVersion [as 别名]
 def isMovieSet():
     folderPathId = "videodb://1/7/"
     # The ID for the TV Show Title changed in Gotham
     if Settings.getXbmcMajorVersion() > 12:
         folderPathId = "videodb://movies/sets/"
     return xbmc.getCondVisibility("!IsEmpty(ListItem.DBID) + SubString(ListItem.Path," + folderPathId + ",left)")
开发者ID:nspierbundel,项目名称:OpenELEC.tv,代码行数:8,代码来源:tvtunes_backend.py

示例6: isRecentEpisodesAdded

# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import getXbmcMajorVersion [as 别名]
 def isRecentEpisodesAdded():
     folderPathId = "videodb://5/"
     # The ID for the Recent Episodes changed in Gotham
     if Settings.getXbmcMajorVersion() > 12:
         folderPathId = "videodb://recentlyaddedepisodes/"
     return xbmc.getInfoLabel("container.folderpath") == folderPathId
开发者ID:nspierbundel,项目名称:OpenELEC.tv,代码行数:8,代码来源:tvtunes_backend.py


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