diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2015-03-11 18:49:31 +0100 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2015-03-11 18:49:31 +0100 |
| commit | a7119803c420373903ac289eb44fc01b64a58ef7 (patch) | |
| tree | c6650d43801d436f2a65909ad8fecc5dd336f523 | |
| parent | 6aefd207ecf8df4a8a594b47f9e27a7e0a26e3c4 (diff) | |
normalize module direct testing with a proper config
| -rw-r--r-- | py3status/modules/battery_level.py | 6 | ||||
| -rw-r--r-- | py3status/modules/bitcoin_price.py | 6 | ||||
| -rw-r--r-- | py3status/modules/clementine.py | 6 | ||||
| -rw-r--r-- | py3status/modules/empty_class.py | 6 | ||||
| -rw-r--r-- | py3status/modules/glpi.py | 6 | ||||
| -rw-r--r-- | py3status/modules/imap.py | 6 | ||||
| -rw-r--r-- | py3status/modules/keyboard_layout.py | 8 | ||||
| -rw-r--r-- | py3status/modules/mpd_status.py | 6 | ||||
| -rw-r--r-- | py3status/modules/net_rate.py | 6 | ||||
| -rw-r--r-- | py3status/modules/netdata.py | 10 | ||||
| -rw-r--r-- | py3status/modules/ns_checker.py | 6 | ||||
| -rw-r--r-- | py3status/modules/pingdom.py | 6 | ||||
| -rw-r--r-- | py3status/modules/pomodoro.py | 6 | ||||
| -rw-r--r-- | py3status/modules/scratchpad_counter.py | 6 | ||||
| -rw-r--r-- | py3status/modules/spaceapi.py | 17 | ||||
| -rw-r--r-- | py3status/modules/sysdata.py | 8 | ||||
| -rw-r--r-- | py3status/modules/vnstat.py | 6 | ||||
| -rw-r--r-- | py3status/modules/weather_yahoo.py | 6 | ||||
| -rw-r--r-- | py3status/modules/whoami.py | 6 | ||||
| -rw-r--r-- | py3status/modules/window_title.py | 6 |
20 files changed, 111 insertions, 28 deletions
diff --git a/py3status/modules/battery_level.py b/py3status/modules/battery_level.py index fd7c22d..f3cbb37 100644 --- a/py3status/modules/battery_level.py +++ b/py3status/modules/battery_level.py @@ -116,6 +116,10 @@ class Py3status: if __name__ == "__main__": from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.battery_level([], {})) + print(x.battery_level([], config)) sleep(1) diff --git a/py3status/modules/bitcoin_price.py b/py3status/modules/bitcoin_price.py index 18b3348..656797c 100644 --- a/py3status/modules/bitcoin_price.py +++ b/py3status/modules/bitcoin_price.py @@ -126,6 +126,10 @@ if __name__ == '__main__': """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.get_rate([], {'color_good': 'green', 'color_bad': 'red'})) + print(x.get_rate([], config)) sleep(5) diff --git a/py3status/modules/clementine.py b/py3status/modules/clementine.py index fd29153..faadf1e 100644 --- a/py3status/modules/clementine.py +++ b/py3status/modules/clementine.py @@ -72,6 +72,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.clementine([], {})) + print(x.clementine([], config)) sleep(1) diff --git a/py3status/modules/empty_class.py b/py3status/modules/empty_class.py index 23f7810..6a7f974 100644 --- a/py3status/modules/empty_class.py +++ b/py3status/modules/empty_class.py @@ -81,6 +81,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.empty([], {})) + print(x.empty([], config)) sleep(1) diff --git a/py3status/modules/glpi.py b/py3status/modules/glpi.py index 86922f8..db648e0 100644 --- a/py3status/modules/glpi.py +++ b/py3status/modules/glpi.py @@ -60,6 +60,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.count_glpi_open_tickets([], {})) + print(x.count_glpi_open_tickets([], config)) sleep(1) diff --git a/py3status/modules/imap.py b/py3status/modules/imap.py index a52c848..d7ce5be 100644 --- a/py3status/modules/imap.py +++ b/py3status/modules/imap.py @@ -58,6 +58,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.check_mail([], {})) + print(x.check_mail([], config)) sleep(1) diff --git a/py3status/modules/keyboard_layout.py b/py3status/modules/keyboard_layout.py index b62268e..f7a570c 100644 --- a/py3status/modules/keyboard_layout.py +++ b/py3status/modules/keyboard_layout.py @@ -26,6 +26,7 @@ LANG_COLORS = { LAYOUT_RE = re.compile(r".*layout:\s*(\w+).*", flags=re.DOTALL) + def xbklayout(): """ check using xkblayout-state (preferred method) @@ -46,6 +47,7 @@ def setxkbmap(): return re.match(LAYOUT_RE, out).group(1) + class Py3status: # available configuration parameters @@ -84,6 +86,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.keyboard_layout([], {})) + print(x.keyboard_layout([], config)) sleep(1) diff --git a/py3status/modules/mpd_status.py b/py3status/modules/mpd_status.py index aa48f96..10f3c99 100644 --- a/py3status/modules/mpd_status.py +++ b/py3status/modules/mpd_status.py @@ -122,6 +122,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.current_track([], {})) + print(x.current_track([], config)) sleep(1) diff --git a/py3status/modules/net_rate.py b/py3status/modules/net_rate.py index 4e2b061..876f6cb 100644 --- a/py3status/modules/net_rate.py +++ b/py3status/modules/net_rate.py @@ -168,6 +168,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.currentSpeed([], {})) + print(x.currentSpeed([], config)) sleep(1) diff --git a/py3status/modules/netdata.py b/py3status/modules/netdata.py index fc5e60c..fe9406f 100644 --- a/py3status/modules/netdata.py +++ b/py3status/modules/netdata.py @@ -51,7 +51,7 @@ class Py3status: low_traffic = 400 med_speed = 60 med_traffic = 700 - nic = 'eth0' + nic = 'wlp2s0' def __init__(self): self.old_transmitted = 0 @@ -119,7 +119,11 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.net_speed([], {})) - print(x.net_traffic([], {})) + print(x.net_speed([], config)) + print(x.net_traffic([], config)) sleep(1) diff --git a/py3status/modules/ns_checker.py b/py3status/modules/ns_checker.py index a79fdd6..5fa6384 100644 --- a/py3status/modules/ns_checker.py +++ b/py3status/modules/ns_checker.py @@ -76,6 +76,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.ns_checker([], {})) + print(x.ns_checker([], config)) sleep(1) diff --git a/py3status/modules/pingdom.py b/py3status/modules/pingdom.py index 53919a2..c4ec473 100644 --- a/py3status/modules/pingdom.py +++ b/py3status/modules/pingdom.py @@ -78,6 +78,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.pingdom_checks([], {})) + print(x.pingdom_checks([], config)) sleep(1) diff --git a/py3status/modules/pomodoro.py b/py3status/modules/pomodoro.py index 39279c1..1a167b9 100644 --- a/py3status/modules/pomodoro.py +++ b/py3status/modules/pomodoro.py @@ -128,6 +128,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.pomodoro([], {})) + print(x.pomodoro([], config)) sleep(1) diff --git a/py3status/modules/scratchpad_counter.py b/py3status/modules/scratchpad_counter.py index 0ee9a49..4bfad23 100644 --- a/py3status/modules/scratchpad_counter.py +++ b/py3status/modules/scratchpad_counter.py @@ -57,6 +57,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.scratchpad_counter([], {})) + print(x.scratchpad_counter([], config)) sleep(1) diff --git a/py3status/modules/spaceapi.py b/py3status/modules/spaceapi.py index 8703fc9..c4fbf12 100644 --- a/py3status/modules/spaceapi.py +++ b/py3status/modules/spaceapi.py @@ -13,6 +13,7 @@ import json from time import time import urllib.request + class Py3status: """ Configuration Parameters: @@ -46,13 +47,13 @@ class Py3status: if not self.closed_color: self.closed_color = '' - # grab json file - json_file=urllib.request.urlopen(self.url) + # grab json file + json_file = urllib.request.urlopen(self.url) reader = codecs.getreader("utf-8") data = json.load(reader(json_file)) json_file.close() - - if(data['state']['open'] == True): + + if(data['state']['open'] is True): response['full_text'] = self.open_text response['short_text'] = '%H:%M' if self.open_color: @@ -69,7 +70,7 @@ class Py3status: response['short_text'] = dt.strftime(response['short_text']) except: - response['full_text'] = ''; + response['full_text'] = '' return response @@ -79,6 +80,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.check([], {'color_good': 'green'})) + print(x.check([], config)) sleep(1) diff --git a/py3status/modules/sysdata.py b/py3status/modules/sysdata.py index cea950d..0badbe0 100644 --- a/py3status/modules/sysdata.py +++ b/py3status/modules/sysdata.py @@ -145,7 +145,11 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.cpuInfo([], {})) - print(x.ramInfo([], {})) + print(x.cpuInfo([], config)) + print(x.ramInfo([], config)) sleep(1) diff --git a/py3status/modules/vnstat.py b/py3status/modules/vnstat.py index 0da6fd2..ad33b71 100644 --- a/py3status/modules/vnstat.py +++ b/py3status/modules/vnstat.py @@ -130,6 +130,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.currentSpeed([], {})) + print(x.currentSpeed([], config)) sleep(1) diff --git a/py3status/modules/weather_yahoo.py b/py3status/modules/weather_yahoo.py index 2962a75..df202d0 100644 --- a/py3status/modules/weather_yahoo.py +++ b/py3status/modules/weather_yahoo.py @@ -114,6 +114,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.weather_yahoo([], {})) + print(x.weather_yahoo([], config)) sleep(1) diff --git a/py3status/modules/whoami.py b/py3status/modules/whoami.py index f2f8571..884cbf5 100644 --- a/py3status/modules/whoami.py +++ b/py3status/modules/whoami.py @@ -35,6 +35,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.whoami([], {})) + print(x.whoami([], config)) sleep(1) diff --git a/py3status/modules/window_title.py b/py3status/modules/window_title.py index e971722..3972ff6 100644 --- a/py3status/modules/window_title.py +++ b/py3status/modules/window_title.py @@ -66,6 +66,10 @@ if __name__ == "__main__": """ from time import sleep x = Py3status() + config = { + 'color_good': '#00FF00', + 'color_bad': '#FF0000', + } while True: - print(x.window_title([], {})) + print(x.window_title([], config)) sleep(1) |
