From: Oleg Broytman Date: Sun, 11 Apr 2010 19:12:34 +0000 (+0000) Subject: Cleaned up import. X-Git-Tag: v4.0.0~25 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=5da2f9851abc6ac5e00de55de009cb826385f7b5;p=xsetbg.git Cleaned up import. git-svn-id: file:///home/phd/archive/SVN/xsetbg/trunk@43 143022c7-580b-0410-bae3-87f2bf5d3141 --- diff --git a/xsetbg.py b/xsetbg.py index 930a65f..6fe73a8 100755 --- a/xsetbg.py +++ b/xsetbg.py @@ -17,7 +17,19 @@ __license__ = "GNU GPL" 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): @@ -25,8 +37,6 @@ 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) @@ -102,11 +112,6 @@ filename_key = "filename" 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: @@ -216,11 +221,6 @@ def stop(): 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)])