From c71936c7b13e50d418638133051d311b61eda62b Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Mon, 4 Jun 2018 22:50:48 -0400 Subject: [PATCH] fix timer calling wrong function --- pyArchUpdatesTray.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pyArchUpdatesTray.py b/pyArchUpdatesTray.py index e7d96aa..6b2f9cb 100755 --- a/pyArchUpdatesTray.py +++ b/pyArchUpdatesTray.py @@ -38,20 +38,17 @@ class TrayIcon(Gtk.StatusIcon): menu.popup(None, None, None, self, 3, gtk_time) def restart_timer(self): - #print("start_timer(), self.lastupdate=" + str(self.lastupdate)) if self.update_timer.is_alive(): self.update_timer.cancel() - self.update_timer = threading.Timer(self.check_interval, self.run_checkupdates) - #self.update_timer = threading.Timer(2, self.restart_timer) + self.update_timer = threading.Timer(self.check_interval, self.restart_timer) self.update_timer.start() self.run_checkupdates(None) - def run_checkupdates(self, widget, force_update=False): + def run_checkupdates(self, widget=None, force_update=False): cur_time = time.mktime(time.localtime()) - + if cur_time > self.check_interval + self.lastupdate or force_update == True: - print("Checking for updates") self.lastupdate = cur_time output = subprocess.run("checkupdates", stdout=subprocess.PIPE) parsed = output.stdout.decode("utf-8")