Пример #1
0
 def update(self):
     updated = Update.last_checked()
     if updated:
         fmt = time.strftime('%d %b %Y, %H:%M:%S', time.localtime(updated))
         self.set("Last checked: %s" % fmt)
     else:
         self.set('')
Пример #2
0
 def update(self):
     updated = Update.last_checked()
     if updated:
         fmt = time.strftime('%d %b %Y, %H:%M:%S', time.localtime(updated))
         self.set("Last checked: %s" % fmt)
     else:
         self.set('')
Пример #3
0
 def refresh(self, force=False):
     try:
         self.is_refreshing = True
         self.enable(False)
         self.set(Update.all(force))
         if self.refresh_callback:
             self.refresh_callback()
     except Update.ConnectionError:
         raise UpdateList.ConnectionError
     finally:
         self.enable(True)
         self.is_refreshing = False
Пример #4
0
 def refresh(self, force=False):
     try:
         self.is_refreshing = True
         self.enable(False)
         self.set(Update.all(force))
         if self.refresh_callback:
             self.refresh_callback()
     except Update.ConnectionError:
         raise UpdateList.ConnectionError
     finally:
         self.enable(True)
         self.is_refreshing = False
Пример #5
0
    def check_for_updates(self):
        """Open updates window unless ran in last hour"""

        if self.should_check_for_updates():
            try:
                skip_patches = bool(Storage.get('ignore_patch_updates'))
                updates = Update.all(force=True, skip_patches=skip_patches)
            except Update.ConnectionError:
                logger.info("Couldn't connect to the internet")
                return

            if updates:
                logger.info("%d new updates found", len(updates))

                Bus().emit("newUpdatesFound", updates)
            else:
                logger.info("No new updates found")
        else:
            logger.info("Skipping a check for new updates")
Пример #6
0
 def get_updates(self, force):
     skip_patches = bool(Storage.get("ignore_patch_updates"))
     return Update.all(force, skip_patches=skip_patches)
Пример #7
0
 def should_check_for_updates(self):
     return bool(Storage.get('check_on_startup')) and \
         not Update.checked_recently()
Пример #8
0
 def should_check_for_updates(self):
     return bool(Storage.get('check_on_startup')) and \
         not Update.checked_recently()