diff options
| author | Ultrabug <ultrabug@gentoo.org> | 2013-04-08 17:22:57 +0200 |
|---|---|---|
| committer | Ultrabug <ultrabug@gentoo.org> | 2013-04-08 17:22:57 +0200 |
| commit | 6afb58c4c8c990e5124006ada1cf4fc2041e9af5 (patch) | |
| tree | 191448f029baae52be190cea409ec44469f73b11 /py3status | |
| parent | e9507b2de80f21d1bb464739393a92a332e60d73 (diff) | |
handle SIGUSR1 for new threaded modules execution, drop useless globals
Diffstat (limited to 'py3status')
| -rwxr-xr-x | py3status/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/py3status/__init__.py b/py3status/__init__.py index 79845a1..9605fa7 100755 --- a/py3status/__init__.py +++ b/py3status/__init__.py @@ -68,8 +68,6 @@ DISABLE_TRANSFORM = False I3STATUS_CONFIG = '/etc/i3status.conf' INCLUDE_PATH = '.i3/py3status' INTERVAL = 1 -USER_CACHE = {} -USER_CLASSES = {} # functions ################################################################################ @@ -340,6 +338,13 @@ class UserModules(Thread): """ self.kill = True + def clear(self): + """ + clear user cache + """ + self.cache = {} + print self.cache + def run(self): """ periodically execute user classes @@ -358,7 +363,7 @@ def main(): try: # global definition global CACHE_TIMEOUT, DISABLE_TRANSFORM - global I3STATUS_CONFIG, INCLUDE_PATH, INTERVAL, USER_CACHE, USER_CLASSES + global I3STATUS_CONFIG, INCLUDE_PATH, INTERVAL # command line options parser = argparse.ArgumentParser( @@ -477,7 +482,7 @@ def main(): msg = sys.exc_info()[1] syslog(LOG_INFO, str(msg)) call(["killall", "-s", "USR1", "i3status"]) - USER_CACHE = {} + modules_thread.clear() forced = True except KeyboardInterrupt: break |
