]> git.phdru.name Git - xsetbg.git/blobdiff - xsetbg-wsgi.py
Changed the way @published works.
[xsetbg.git] / xsetbg-wsgi.py
index c90da9258c13df1d2c7b7001c2c1ee389182f1a5..0e47b7f16cd6ff94e9d73241f1264adea749140c 100755 (executable)
@@ -20,8 +20,10 @@ simple_server.ServerHandler = SimpleHandler # Stop logging to stdout
 from xsetbg import host, port, change as _change
 
 
+commands = {}
+
 def published(func):
-    func._wsgi_published = True
+    commands[func.__name__] = func
     return func
 
 @published
@@ -37,11 +39,6 @@ def stop():
     QuitWSGIServer._quit_flag = True
 
 
-g = globals().copy()
-commands = dict([(name, g[name]) for name in g
-    if getattr(g[name], '_wsgi_published', False)])
-del g
-
 class QuitWSGIServer(WSGIServer):
     _quit_flag = False