本文整理汇总了Python中Plugins.Extensions.archivCZSK.archivczsk.ArchivCZSK.has_addon方法的典型用法代码示例。如果您正苦于以下问题:Python ArchivCZSK.has_addon方法的具体用法?Python ArchivCZSK.has_addon怎么用?Python ArchivCZSK.has_addon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins.Extensions.archivCZSK.archivczsk.ArchivCZSK
的用法示例。
在下文中一共展示了ArchivCZSK.has_addon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resolve_dependencies
# 需要导入模块: from Plugins.Extensions.archivCZSK.archivczsk import ArchivCZSK [as 别名]
# 或者: from Plugins.Extensions.archivCZSK.archivczsk.ArchivCZSK import has_addon [as 别名]
def resolve_dependencies(self):
from Plugins.Extensions.archivCZSK.archivczsk import ArchivCZSK
log.info("trying to resolve dependencies for %s" , self.video_addon)
for dependency in self.video_addon.requires:
addon_id, version, optional = dependency['addon'], dependency['version'], dependency['optional']
# checking if archivCZSK version is compatible with this plugin
if addon_id == 'enigma2.archivczsk':
if not util.check_version(aczsk.version, version):
log.debug("archivCZSK version %s>=%s" , aczsk.version, version)
else:
log.debug("archivCZSK version %s<=%s" , aczsk.version, version)
raise AddonError(_("You need to update archivCZSK at least to") + " " + version + " " + _("version"))
log.info("%s requires %s addon, version %s" , self.video_addon, addon_id, version)
if ArchivCZSK.has_addon(addon_id):
tools_addon = ArchivCZSK.get_addon(addon_id)
log.info("required %s founded" , tools_addon)
if not util.check_version(tools_addon.version, version):
log.debug("version %s>=%s" , tools_addon.version, version)
self._dependencies.append(tools_addon)
else:
log.debug("version %s<=%s" , tools_addon.version, version)
if not optional:
log.error("cannot execute %s " , self.video_addon)
raise AddonError("Cannot execute addon %s, dependency %s version %s needs to be at least version %s"
% (self.video_addon, tools_addon.id, tools_addon.version, version))
else:
log.debug("skipping")
continue
else:
log.info("required %s addon not founded" , addon_id)
if not optional:
log.info("cannot execute %s addon" , self.video_addon)
raise Exception("Cannot execute %s, missing dependency %s" % (self.video_addon, addon_id))
else:
log.debug("skipping")