From 8f705ab8bcd0bdda85f6308fc53b0346d3d14369 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Mon, 21 Sep 2020 08:13:35 +0200 Subject: [PATCH] aptdaemon might not always be awailable --- argos-apt.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/argos-apt.py b/argos-apt.py index d719c05..0c3742c 100755 --- a/argos-apt.py +++ b/argos-apt.py @@ -11,7 +11,6 @@ # python,aptdaemon,apt # https://github.com/schtobia/argos-httping/blob/master/httping.py -from aptdaemon import client from apt import Cache import sys @@ -28,8 +27,13 @@ class Themes: original = ["#acacac","#ff0101","#cc673b","#ce8458","#6bbb15","#0ed812"] selected_colors = red_green -apt_client = client.AptClient() -apt_client.update_cache(wait=True) +try: + from aptdaemon import client + apt_client = client.AptClient() + apt_client.update_cache(wait=True) +except ImportError as err: + print(str(err), file=sys.stderr) + cache = Cache() cache.open() update_list = [pkg for pkg in cache if pkg.is_upgradable]