import sys, os
+from ConfigParser import SafeConfigParser
+
+import anydbm
+import random
+import shelve
import subprocess
+from time import time
+from fcntl import flock, LOCK_EX, LOCK_UN, LOCK_NB
+
+from wsgiref import simple_server
+from wsgiref.handlers import SimpleHandler
+from wsgiref.simple_server import WSGIServer, make_server
+simple_server.ServerHandler = SimpleHandler # Stop logging to stdout
def error(error_str, error_code=1):
sys.exit(error_code)
-from ConfigParser import SafeConfigParser
-
xsetbg_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(xsetbg_dir)
old_filename_key = "old_filename"
-import random
-import anydbm, shelve
-from time import time
-from fcntl import flock, LOCK_EX, LOCK_UN, LOCK_NB
-
# Create the database if it is not exists yet.
try:
QuitWSGIServer._quit_flag = True
-from wsgiref.handlers import SimpleHandler
-from wsgiref import simple_server
-simple_server.ServerHandler = SimpleHandler # Stop logging to stdout
-from wsgiref.simple_server import WSGIServer, make_server
-
g = globals().copy()
commands = dict([(name, g[name]) for name in g
if getattr(g[name], '_wsgi_published', False)])