[modules/speedtest] make speedtest re-triggerable

This commit is contained in:
tobi-wan-kenobi 2020-06-25 20:44:55 +02:00
parent 7a6788dc1c
commit 44b3df5827

View file

@ -9,6 +9,7 @@ Requires the following python module:
import core.module import core.module
import core.widget import core.widget
import core.input
import core.decorators import core.decorators
import speedtest import speedtest
@ -26,9 +27,14 @@ class Module(core.module.Module):
start = self.add_widget(name="start") start = self.add_widget(name="start")
main = self.add_widget(name="main", full_text=self.result) 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, _): def result(self, _):
return self.__result return self.__result
def update_event(self, _):
self.update()
def update(self): def update(self):
self.__running = True self.__running = True
s = speedtest.Speedtest() s = speedtest.Speedtest()