예제 #1
0
    def resolve_dependencies(self):
        from Plugins.Extensions.archivCZSK.archivczsk import ArchivCZSK
        log.info("%s trying to resolve dependencies for %s", self,
                 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("%s archivCZSK version %s>=%s", self,
                              aczsk.version, version)
                else:
                    log.debug("%s archivCZSK version %s<=%s", self,
                              aczsk.version, version)
                    raise AddonError(
                        _("You need to update archivCZSK at least to") + " " +
                        version + " " + _("version"))

            log.info("%s requires %s addon, version %s", self, addon_id,
                     version)
            if ArchivCZSK.has_addon(addon_id):
                tools_addon = ArchivCZSK.get_addon(addon_id)
                log.debug("%s required %s founded", self, tools_addon)
                if not util.check_version(tools_addon.version, version):
                    log.debug("%s version %s>=%s", self, tools_addon.version,
                              version)
                    self._dependencies.append(tools_addon)
                else:
                    log.debug("%s version %s<=%s", self, tools_addon.version,
                              version)
                    if not optional:
                        log.error("%s cannot execute", self)
                        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("%s skipping")
                        continue
            else:
                log.error("%s required %s addon not founded", self, addon_id)
                if not optional:
                    log.error("%s cannot execute %s addon", self,
                              self.video_addon)
                    raise Exception(
                        "Cannot execute %s, missing dependency %s" %
                        (self.video_addon, addon_id))
                else:
                    log.debug("skipping")
예제 #2
0
def showError(error, timeout=5):
    raise AddonError(error)