diff --git a/local.py b/local.py index edbd7e2..94b2d2a 100755 --- a/local.py +++ b/local.py @@ -26,10 +26,11 @@ if sys.version_info < (2, 6): import simplejson as json else: import json - + try: - import gevent, gevent.monkey - gevent.monkey.patch_all(dns=gevent.version_info[0]>=1) + import gevent + import gevent.monkey + gevent.monkey.patch_all(dns=gevent.version_info[0] >= 1) except ImportError: gevent = None print >>sys.stderr, 'warning: gevent not found, using threading instead' @@ -38,21 +39,11 @@ import socket import select import SocketServer import struct -import string -import hashlib import os import logging import getopt +import encrypt -def get_table(key): - m = hashlib.md5() - m.update(key) - s = m.digest() - (a, b) = struct.unpack('=1) + import gevent + import gevent.monkey + gevent.monkey.patch_all(dns=gevent.version_info[0] >= 1) except ImportError: gevent = None print >>sys.stderr, 'warning: gevent not found, using threading instead' @@ -38,21 +39,11 @@ import socket import select import SocketServer import struct -import string -import hashlib import os import logging import getopt +import encrypt -def get_table(key): - m = hashlib.md5() - m.update(key) - s = m.digest() - (a, b) = struct.unpack('