[Merge] ~nteodosio/update-manager:purgeidleloop2 into update-manager:main
Marco Trevisan (TreviƱo)
mp+475111 at code.launchpad.net
Tue Oct 15 15:01:25 UTC 2024
Diff comments:
> diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py
> index 7f75914..903d4ee 100644
> --- a/UpdateManager/UpdateManager.py
> +++ b/UpdateManager/UpdateManager.py
> @@ -277,22 +274,23 @@ class UpdateManager(Gtk.Window):
> if fnmatch.fnmatch(pkg.name, "oem-*-meta") and pkg.installed:
> self.oem_metapackages.add(pkg)
>
> - def _fetch_ua_updates(self):
> + def _fetch_ua_updates(self, cb=None):
> try:
> self.ua_updates = ua.updates().updates
> except Exception as e:
> print("Error running updates end-point: ", e)
> self.ua_updates = []
> + if cb:
> + cb()
>
> def _get_ua_security_status(self):
> self.ua_security_packages = []
> self.ua_updates = []
> - t = threading.Thread(target=self._fetch_ua_updates, daemon=True)
> + t = threading.Thread(target=self._fetch_ua_updates, daemon=True,
> + kwargs={'cb': self.sift_pro_packages})
Not sure if the previous comment was lost here, but you should still call `self.sift_pro_packages` in the main loop, through a GLib Idle here.
> t.start()
> - while t.is_alive():
> - while Gtk.events_pending():
> - Gtk.main_iteration()
> - time.sleep(0.05)
> +
> + def sift_pro_packages(self):
> for package in self.ua_updates:
> if (
> package.provided_by == 'standard-security'
--
https://code.launchpad.net/~nteodosio/update-manager/+git/update-manager/+merge/475111
Your team Ubuntu Core Development Team is subscribed to branch update-manager:main.
More information about the Ubuntu-reviews
mailing list