本文整理汇总了Python中settings.Settings.isActivePlugins方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.isActivePlugins方法的具体用法?Python Settings.isActivePlugins怎么用?Python Settings.isActivePlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类settings.Settings
的用法示例。
在下文中一共展示了Settings.isActivePlugins方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: showRootMenu
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isActivePlugins [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([], 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([], 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([], 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(32204), 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: checkPlugins
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isActivePlugins [as 别名]
def checkPlugins(self):
navPath = xbmc.getInfoLabel("Container.FolderPath")
if 'plugin://' not in navPath:
# No Plugin currently set
self.lastPluginChecked = ""
return
# Check if we are in a plugin location
pluginName = xbmc.getInfoLabel("Container.FolderName")
if pluginName in [None, "", self.lastPluginChecked]:
# No Plugin currently set or this is a Plugin that has already been checked
return
# If we reach here we have aPlugin that we need to check
log("NavigationRestrictions: Checking access to view Plugin: %s" % pluginName)
self.lastPluginChecked = pluginName
# Check for the case where the user does not want to check plugins
# but the Pin Sentry plugin is selected, we always need to check this
# as it is how permissions are set
if (not Settings.isActivePlugins()) and ('PinSentry' not in pluginName):
return
securityLevel = 0
# Check to see if the user should have access to this plugin
pinDB = PinSentryDB()
securityLevel = pinDB.getPluginSecurityLevel(pluginName)
if securityLevel < 1:
# Check for the special case that we are accessing ourself
# in which case we have a minimum security level
if 'PinSentry' in pluginName:
securityLevel = Settings.getSettingsSecurityLevel()
else:
log("NavigationRestrictions: No security enabled for plugin %s" % pluginName)
return
del pinDB
# Check if we have already cached the pin number and at which level
if PinSentry.getCachedPinLevel() >= securityLevel:
log("NavigationRestrictions: Already cached pin at level %d, allowing access" % PinSentry.getCachedPinLevel())
return
# Prompt the user for the pin, returns True if they knew it
if PinSentry.promptUserForPin(securityLevel):
log("NavigationRestrictions: Allowed access to plugin %s" % pluginName)
else:
log("NavigationRestrictions: Not allowed access to plugin %s which has security level %d" % (pluginName, securityLevel))
# Move back to the Video plugin Screen as they are not allowed where they are at the moment
xbmc.executebuiltin("ActivateWindow(Video,addons://sources/video/)", True)
# Clear the previous plugin as we will want to prompt for the pin again if the
# user navigates there again
self.lastPluginChecked = ""
PinSentry.displayInvalidPinMessage(securityLevel)
示例3: showRootMenu
# 需要导入模块: from settings import Settings [as 别名]
# 或者: from settings.Settings import isActivePlugins [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)