[modules/speedtest] make speedtest re-triggerable
This commit is contained in:
parent
7a6788dc1c
commit
44b3df5827
1 changed files with 6 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue