Ejemplo n.º 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")
Ejemplo n.º 2
0
    def check_addon(self, addon, update_xml=True):
        """
        check if addon needs update and if its broken
        """
        try:
            log.debug("checking updates for %s", addon.name)
            self._get_server_addon(addon, update_xml)

            broken = self.remote_addons_dict[addon.id]['broken']
            remote_version = self.remote_addons_dict[addon.id]['version']
            local_version = addon.version

            if util.check_version(local_version, remote_version):
                log.logDebug("Addon '%s' need update (local %s < remote %s)." %
                             (addon.name, local_version, remote_version))
                log.debug("%s local version %s < remote version %s",
                          addon.name, local_version, remote_version)
                log.debug("%s is not up to date", addon.name)
                return True, broken
            else:
                log.logDebug("Addon '%s' (%s) is up to date." %
                             (addon.name, local_version))
                log.debug("%s local version %s >= remote version %s",
                          addon.name, local_version, remote_version)
                log.debug("%s is up to date", addon.name)
            return False, broken
        except:
            log.logError("Check addon '%s' update failed.\n%s" %
                         (addon.name, traceback.format_exc()))
            raise
Ejemplo n.º 3
0
 def check_addon(self, addon, update_xml=True):
     """
     check if addon needs update and if its broken
     """
     try:
         log.debug("checking updates for %s", addon.name)
         self._get_server_addon(addon, update_xml)
     
         broken = self.remote_addons_dict[addon.id]['broken']
         remote_version = self.remote_addons_dict[addon.id]['version']
         local_version = addon.version
     
         if util.check_version(local_version, remote_version):
             log.logDebug("Addon '%s' need update (local %s < remote %s)." % (addon.name, local_version, remote_version))
             log.debug("%s local version %s < remote version %s", addon.name, local_version, remote_version)
             log.debug("%s is not up to date", addon.name)
             return True, broken
         else:
             log.logDebug("Addon '%s' (%s) is up to date." % (addon.name, local_version))
             log.debug("%s local version %s >= remote version %s", addon.name, local_version, remote_version)
             log.debug("%s is up to date", addon.name)
         return False, broken
     except:
         log.logError("Check addon '%s' update failed.\n%s" % (addon.name, traceback.format_exc()))
         raise
Ejemplo n.º 4
0
    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")
Ejemplo n.º 5
0
            def check_archiv():
                try:
                    if self.downloadUpdateXml():
                        from Plugins.Extensions.archivCZSK.version import version
                        local_version = version
                        xmlroot = util.load_xml(self.updateXmlFilePath).getroot()
                        self.remote_version = xmlroot.attrib.get('version')
                        log.logDebug("ArchivUpdater version local/remote: %s/%s" % (local_version, self.remote_version))

                        if util.check_version(local_version, self.remote_version):
                            self.needUpdate = True
                        else:
                            self.needUpdate = False
                    else:
                        self.needUpdate = False
                except:
                    log.logError("ArchivUpdater compare versions failed.\n%s"%traceback.format_exc())
Ejemplo n.º 6
0
 def check_addon(self, addon, update_xml=True):
     """
     check if addon needs update and if its broken
     """
     
     log.debug("checking updates for %s", addon.name)
     self._get_server_addon(addon, update_xml)
     
     broken = self.remote_addons_dict[addon.id]['broken']
     remote_version = self.remote_addons_dict[addon.id]['version']
     local_version = addon.version
     
     if util.check_version(local_version, remote_version):
         log.debug("%s local version %s < remote version %s", addon.name, local_version, remote_version)
         log.debug("%s is not up to date", addon.name)
         return True, broken
     else:
         log.debug("%s local version %s >= remote version %s", addon.name, local_version, remote_version)
         log.debug("%s is up to date", addon.name)
     return False, broken
Ejemplo n.º 7
0
    def check_addon(self, addon, update_xml=True):
        """
        check if addon needs update and if its broken
        """

        log.debug("checking updates for %s", addon.name)
        self._get_server_addon(addon, update_xml)

        broken = self.remote_addons_dict[addon.id]['broken']
        remote_version = self.remote_addons_dict[addon.id]['version']
        local_version = addon.version

        if util.check_version(local_version, remote_version):
            log.debug("%s local version %s < remote version %s", addon.name,
                      local_version, remote_version)
            log.debug("%s is not up to date", addon.name)
            return True, broken
        else:
            log.debug("%s local version %s >= remote version %s", addon.name,
                      local_version, remote_version)
            log.debug("%s is up to date", addon.name)
        return False, broken