本文整理汇总了Python中settings.Settings.isActiveFileSource方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.isActiveFileSource方法的具体用法?Python Settings.isActiveFileSource怎么用?Python Settings.isActiveFileSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.Settings
的用法示例。
在下文中一共展示了Settings.isActiveFileSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: showRootMenu
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isActiveFileSource [as 别名]
def showRootMenu(self):
# Movies
url = self._build_url({'mode': 'folder', 'foldername': MenuNavigator.MOVIES})
li = xbmcgui.ListItem(__addon__.getLocalizedString(32201), iconImage=__icon__)
li.setProperty("Fanart_Image", __fanart__)
li.addContextMenuItems(self._getContextMenu(MenuNavigator.MOVIES), replaceItems=True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=True)
# TV Shows
url = self._build_url({'mode': 'folder', 'foldername': MenuNavigator.TVSHOWS})
li = xbmcgui.ListItem(__addon__.getLocalizedString(32202), iconImage=__icon__)
li.setProperty("Fanart_Image", __fanart__)
li.addContextMenuItems(self._getContextMenu(MenuNavigator.TVSHOWS), replaceItems=True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=True)
# Movie Sets
url = self._build_url({'mode': 'folder', 'foldername': MenuNavigator.MOVIESETS})
li = xbmcgui.ListItem(__addon__.getLocalizedString(32203), iconImage=__icon__)
li.setProperty("Fanart_Image", __fanart__)
li.addContextMenuItems(self._getContextMenu(MenuNavigator.MOVIESETS), replaceItems=True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=True)
# Music Videos
url = self._build_url({'mode': 'folder', 'foldername': MenuNavigator.MUSICVIDEOS})
li = xbmcgui.ListItem(__addon__.getLocalizedString(32205), iconImage=__icon__)
li.setProperty("Fanart_Image", __fanart__)
li.addContextMenuItems(self._getContextMenu(MenuNavigator.MUSICVIDEOS), replaceItems=True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=True)
# Plugins
if Settings.isActivePlugins():
url = self._build_url({'mode': 'folder', 'foldername': MenuNavigator.PLUGINS})
li = xbmcgui.ListItem(__addon__.getLocalizedString(32128), iconImage=__icon__)
li.setProperty("Fanart_Image", __fanart__)
li.addContextMenuItems([], replaceItems=True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=True)
# Files
if Settings.isActiveFileSource():
url = self._build_url({'mode': 'folder', 'foldername': MenuNavigator.FILESOURCE})
li = xbmcgui.ListItem(__addon__.getLocalizedString(32204), iconImage=__icon__)
li.setProperty("Fanart_Image", __fanart__)
li.addContextMenuItems([], replaceItems=True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=True)
# Classifications
url = self._build_url({'mode': 'folder', 'foldername': MenuNavigator.CLASSIFICATIONS})
li = xbmcgui.ListItem(__addon__.getLocalizedString(32206), iconImage=__icon__)
li.setProperty("Fanart_Image", __fanart__)
li.addContextMenuItems([], replaceItems=True)
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=True)
xbmcplugin.endOfDirectory(self.addon_handle)
示例2: onPlayBackStarted
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isActiveFileSource [as 别名]
def onPlayBackStarted(self):
if not Settings.isActiveVideoPlaying():
return
log("PinSentryPlayer: Notification that something started playing")
# Only interested if it is not playing music
if self.isPlayingAudio():
return
# Ignore screen saver videos
if xbmcgui.Window(10000).getProperty("VideoScreensaverRunning"):
log("PinSentryPlayer: Detected VideoScreensaver playing")
return
# Check if the Pin is set, as no point prompting if it is not
if not PinSentry.isPinSentryEnabled():
return
isMusicVideo = False
isTvShow = False
# Get the information for what is currently playing
# http://kodi.wiki/view/InfoLabels#Video_player
title = xbmc.getInfoLabel("VideoPlayer.TVShowTitle")
# If the TvShow Title is not set, then Check the ListItem as well
if title in [None, ""]:
title = xbmc.getInfoLabel("ListItem.TVShowTitle")
securityLevel = 0
# If it is a TvShow, then check to see if it is enabled for this one
if title not in [None, ""]:
isTvShow = True
log("PinSentryPlayer: TVShowTitle: %s" % title)
pinDB = PinSentryDB()
securityLevel = pinDB.getTvShowSecurityLevel(title)
del pinDB
else:
# Check if the video is a music video
isMusicVideo = self.isMusicVideoPlaying()
# Not a TvShow, so check for the Movie Title
title = xbmc.getInfoLabel("VideoPlayer.Title")
# If no title is found, check the ListItem rather then the Player
if title in [None, ""]:
title = xbmc.getInfoLabel("ListItem.Title")
if title not in [None, ""]:
if not isMusicVideo:
# Check for a Movie
log("PinSentryPlayer: Title: %s" % title)
pinDB = PinSentryDB()
securityLevel = pinDB.getMovieSecurityLevel(title)
del pinDB
else:
# Now check to see if this is music video
log("PinSentryPlayer: Checking Music video for: %s" % title)
pinDB = PinSentryDB()
securityLevel = pinDB.getMusicVideoSecurityLevel(title)
del pinDB
# For video files it is possible to set them to always be allowed to play, in this case
# the security value is -1 and we don't want to perform any new checking
if securityLevel == -1:
log("PinSentryPlayer: Security level is -1, so allowing access")
return
# Now perform the check that restricts if a file is in a file source
# that should not be played
if securityLevel < 1 and Settings.isActiveFileSource() and Settings.isActiveFileSourcePlaying():
# Get the path of the file being played
filePath = xbmc.getInfoLabel("Player.Folderpath")
if filePath in [None, ""]:
filePath = xbmc.getInfoLabel("Player.Filenameandpath")
if filePath in [None, ""]:
filePath = xbmc.getInfoLabel("ListItem.FolderPath")
if filePath in [None, ""]:
filePath = xbmc.getInfoLabel("ListItem.FileNameAndPath")
log("PinSentryPlayer: Checking file path: %s" % filePath)
# Get all the sources that are protected
pinDB = PinSentryDB()
securityDetails = pinDB.getAllFileSourcesPathsSecurity()
del pinDB
# Each key is in path with security applied
for key in securityDetails.keys():
if key in filePath:
securityLevel = securityDetails[key]
log("PinSentryPlayer: Setting path based security to %d" % securityLevel)
# Now check to see if this item has a certificate restriction
if securityLevel < 1:
cert = xbmc.getInfoLabel("VideoPlayer.mpaa")
if cert in [None, ""]:
cert = xbmc.getInfoLabel("ListItem.Mpaa")
if cert not in [None, ""]:
log("PinSentryPlayer: Checking for certification restrictions: %s" % str(cert))
#.........这里部分代码省略.........
示例3: log
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isActiveFileSource [as 别名]
# about every minute will be OK
if loopsUntilUserControlCheck < 1:
# If we are going to shut down then start closing down this script
if not userCtrl.check():
break
loopsUntilUserControlCheck = 600
else:
loopsUntilUserControlCheck = loopsUntilUserControlCheck - 1
xbmc.sleep(100)
userCtrl.checkDisplayStatus()
# Check if the Pin is set, as no point prompting if it is not
if PinSentry.isPinSentryEnabled():
# Check to see if we need to restrict navigation access
if Settings.isActiveNavigation():
navRestrictions.checkTvShows()
navRestrictions.checkMovieSets()
if Settings.isActiveFileSource():
navRestrictions.checkFileSources()
# Always call the plugin check as we have to check if the user is setting
# permissions using the PinSentry plugin
navRestrictions.checkPlugins()
navRestrictions.checkSettings()
log("Stopping Pin Sentry Service")
del userCtrl
del navRestrictions
del playerMonitor
del systemMonitor