Beispiel #1
0
 def download_commit(self):
     try:
         log.logInfo("Checking addons update...")
         path = os.path.join(os.path.dirname(__file__), 'commit')
         self.__console = Console()
         self.__console.ePopen('curl -kfo %s https://raw.githubusercontent.com/mx3L/archivczsk-doplnky/master/commit' % path, self.check_commit_download)
     except:
         log.logError("Download addons commit failed.")
         self.open_archive_screen()
Beispiel #2
0
 def checkArchivUpdate(self):
     try:
         log.logInfo("Checking archivCZSK update...")
         upd = ArchivUpdater(self)
         upd.checkUpdate()
     except:
         if config.plugins.archivCZSK.autoUpdate.value and self.canCheckUpdate(False):
             self.download_commit()
         else:
             self.open_archive_screen()
Beispiel #3
0
 def checkArchivUpdate(self):
     try:
         log.logInfo("Checking archivCZSK update...")
         upd = ArchivUpdater(self)
         upd.checkUpdate()
     except:
         if config.plugins.archivCZSK.autoUpdate.value and self.canCheckUpdate(False):
             self.download_commit()
         else:
             self.open_archive_screen()
Beispiel #4
0
 def download_commit(self):
     try:
         log.logInfo("Checking addons update...")
         path = os.path.join(os.path.dirname(__file__), 'commit')
         if os.path.exists(path):
             os.remove(path)
         self.__console = Console()
         self.__console.ePopen('curl -kfo %s https://raw.githubusercontent.com/mx3L/archivczsk-doplnky/master/commit' % path, self.check_commit_download)
     except:
         log.logError("Download addons commit failed.")
         self.open_archive_screen()
Beispiel #5
0
 def download_commit(self):
     try:
         log.logInfo("Checking addons update...")
         path = os.path.join(os.path.dirname(__file__), 'commit')
         if os.path.exists(path):
             os.remove(path)
         self.__updateDialog = self.session.openWithCallback(self.check_updates_finished, MessageBox, 
                                            _("Checking for updates"), 
                                            type=MessageBox.TYPE_INFO, 
                                            enable_input=False)
         self.__console = Console()
         self.__console.ePopen('curl -kfo %s https://raw.githubusercontent.com/mx3L/archivczsk-doplnky/master-next/commit' % path, self.check_commit_download)
     except:
         log.logError("Download addons commit failed.")
         self.open_archive_screen()
Beispiel #6
0
    def doWork(self):
        try:
            lock = threading.Lock()

            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())

            thread = threading.Thread(target=check_archiv)
            thread.start()
            thread.join()

            if self.needUpdate:
                log.logInfo("ArchivUpdater update found...%s" %
                            self.remote_version)
                strMsg = "%s %s?" % (
                    _("Do you want to update archivCZSK to version"),
                    toString(self.remote_version))
                self.archiv.session.openWithCallback(
                    self.updateArchiv,
                    MessageBox,
                    strMsg,
                    type=MessageBox.TYPE_YESNO)
            else:
                self.continueToArchiv()
        except:
            log.logError("ArchivUpdater update failed.\n%s" %
                         traceback.format_exc())
            self.continueToArchiv()
Beispiel #7
0
    def doWork(self):
        try:
            lock = threading.Lock()
            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())

            thread = threading.Thread(target=check_archiv)
            thread.start()
            thread.join()

            if self.needUpdate:
                log.logInfo("ArchivUpdater update found...%s"%self.remote_version)
                strMsg = "%s %s?" %(_("Do you want to update archivCZSK to version"), toString(self.remote_version))
                self.archiv.session.openWithCallback(
                    self.updateArchiv,
                    MessageBox,
                    strMsg,
                    type = MessageBox.TYPE_YESNO)
            else:
                self.continueToArchiv()
        except:
            log.logError("ArchivUpdater update failed.\n%s"%traceback.format_exc())
            self.continueToArchiv()