From 44b3df58271f5af3c001bcc2ccaf734a48c650d0 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Thu, 25 Jun 2020 20:44:55 +0200 Subject: [PATCH] [modules/speedtest] make speedtest re-triggerable --- bumblebee_status/modules/core/speedtest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bumblebee_status/modules/core/speedtest.py b/bumblebee_status/modules/core/speedtest.py index 8f08bf9..2b39cff 100644 --- a/bumblebee_status/modules/core/speedtest.py +++ b/bumblebee_status/modules/core/speedtest.py @@ -9,6 +9,7 @@ Requires the following python module: import core.module import core.widget +import core.input import core.decorators import speedtest @@ -26,9 +27,14 @@ class Module(core.module.Module): start = self.add_widget(name="start") main = self.add_widget(name="main", full_text=self.result) + core.input.register(start, button=core.input.LEFT_MOUSE, cmd=self.update_event) + def result(self, _): return self.__result + def update_event(self, _): + self.update() + def update(self): self.__running = True s = speedtest.Speedtest()