diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2014-12-21 20:07:01 +0100 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2014-12-21 20:07:01 +0100 |
| commit | 2d016637ea3b836fb05ae452a8ea2ddf50ccc619 (patch) | |
| tree | 96ef530103a53426c5bd7e930a9a13fe45c691c2 /py3status/modules | |
| parent | 51205fd4c54499dce894aa1b64b74e343bd51406 (diff) | |
add standalone test code
Diffstat (limited to 'py3status/modules')
| -rw-r--r-- | py3status/modules/sysdata.py | 11 | ||||
| -rw-r--r-- | py3status/modules/vnstat.py | 8 | ||||
| -rw-r--r-- | py3status/modules/weather_yahoo.py | 10 |
3 files changed, 27 insertions, 2 deletions
diff --git a/py3status/modules/sysdata.py b/py3status/modules/sysdata.py index 60283ac..cea950d 100644 --- a/py3status/modules/sysdata.py +++ b/py3status/modules/sysdata.py @@ -138,3 +138,14 @@ class Py3status: response['cached_until'] = time() + self.cache_timeout return response + +if __name__ == "__main__": + """ + Test this module by calling it directly. + """ + from time import sleep + x = Py3status() + while True: + print(x.cpuInfo([], {})) + print(x.ramInfo([], {})) + sleep(1) diff --git a/py3status/modules/vnstat.py b/py3status/modules/vnstat.py index 14c3a9c..0da6fd2 100644 --- a/py3status/modules/vnstat.py +++ b/py3status/modules/vnstat.py @@ -8,7 +8,7 @@ REQUIRE external program called "vnstat" installed and configured to work. """ from __future__ import division # python2 compatibility -from time import time, sleep +from time import time from subprocess import check_output @@ -125,7 +125,11 @@ class Py3status: return response if __name__ == "__main__": + """ + Test this module by calling it directly. + """ + from time import sleep x = Py3status() while True: - print(x.currentSpeed(1, 1)) + print(x.currentSpeed([], {})) sleep(1) diff --git a/py3status/modules/weather_yahoo.py b/py3status/modules/weather_yahoo.py index ad0cecb..2962a75 100644 --- a/py3status/modules/weather_yahoo.py +++ b/py3status/modules/weather_yahoo.py @@ -107,3 +107,13 @@ class Py3status: response['full_text'] = response['full_text'].strip() return response + +if __name__ == "__main__": + """ + Test this module by calling it directly. + """ + from time import sleep + x = Py3status() + while True: + print(x.weather_yahoo([], {})) + sleep(1) |
