本文整理汇总了Python中resources.lib.settings.Settings.showSecurityLevelInPlugin方法的典型用法代码示例。如果您正苦于以下问题:Python Settings.showSecurityLevelInPlugin方法的具体用法?Python Settings.showSecurityLevelInPlugin怎么用?Python Settings.showSecurityLevelInPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类resources.lib.settings.Settings
的用法示例。
在下文中一共展示了Settings.showSecurityLevelInPlugin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setList
# 需要导入模块: from resources.lib.settings import Settings [as 别名]
# 或者: from resources.lib.settings.Settings import showSecurityLevelInPlugin [as 别名]
def _setList(self, target):
items = []
if target == MenuNavigator.PLUGINS:
items = self._setPluginList()
elif target == MenuNavigator.FILESOURCE:
items = self._setFileSourceList()
else:
# Everything other plugins are forms of video
items = self._getVideos(target)
# Now add the security details to the list
items = self._addSecurityFlags(target, items)
# Update the classifications
items = self._cleanClassification(target, items)
for item in items:
# Create the list-item for this video
li = xbmcgui.ListItem(item['title'], iconImage=item['thumbnail'])
# Remove the default context menu
li.addContextMenuItems([], replaceItems=True)
# Get the title of the video
title = item['title']
try:
title = item['title'].encode("utf-8")
except:
pass
# Make sure the dbid is coded correctly
dbid = item['dbid']
try:
dbid = item['dbid'].encode("utf-8")
except:
pass
# Check if the classification is restricting this item
isBlockedByClassification = False
if 'mpaa' in item:
if item['mpaa'] not in [None, ""]:
isBlockedByClassification = True
# Add a tick if security is set
if item['securityLevel'] != 0:
li.setInfo('video', {'PlayCount': 1})
# Not the best display format - but the only way that I can get a number to display
# In the list, the problem is it will display 01:00 - but at least it's something
if Settings.showSecurityLevelInPlugin():
li.setInfo('video', {'Duration': item['securityLevel']})
elif Settings.isHighlightClassificationUnprotectedVideos():
# If the user wishes to see which files are not protected by one of the rules
# currently applied, we put the play signal next to them
if not isBlockedByClassification:
li.setProperty("TotalTime", "")
li.setProperty("ResumeTime", "1")
# Handle the case where we want to turn off security for a video
if isBlockedByClassification and (item['securityLevel'] == -1):
# This is the case where the user has forced access to be allowed, this
# is useful if you have classification enabled and you want to allow a
# given video for a classification to be unprotected
li.setProperty("TotalTime", "")
li.setProperty("ResumeTime", "1")
li.setProperty("Fanart_Image", item['fanart'])
url = self._build_url({'mode': 'setsecurity', 'level': item['securityLevel'], 'type': target, 'title': title, 'id': dbid, 'classificationBlocked': str(isBlockedByClassification)})
xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=url, listitem=li, isFolder=False)
xbmcplugin.endOfDirectory(self.addon_handle)