def _get_cached(cls): logger.info("Fetching cached updates...") cache = Storage.get('update_cache') extensions = [Extension(name=name) for name, _ in cache.items()] for extension in extensions: if extension.is_installed and extension.is_configured: extension.remote.version = Version(cache[extension.name]) return extensions
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")
def get_updates(self, force): skip_patches = bool(Storage.get("ignore_patch_updates")) return Update.all(force, skip_patches=skip_patches)
def last_checked(cls): return Storage.get('last_checked_at') or 0
def should_check_for_updates(self): return bool(Storage.get('check_on_startup')) and \ not Update.checked_recently()
def is_ignored(self): return self.bundle.name in Storage.get('ignore')
def value(self): return bool(Storage.get(self.key))