This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import daemon, lockfile, signal, logging | |
import eventlet | |
from eventlet import wsgi, timeout | |
worker_pool = eventlet.GreenPool(20) | |
sock = eventlet.listen(('', 8000)) | |
def proper_shutdown(): | |
worker_pool.resize(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by https://bitbucket.org/tebeka/pythonwise/src/c68764fa3a8b/enum.py | |
def enum(name, members, bitmask=False): | |
''' | |
>>> Hi = enum('Hi', 'a b c') | |
>>> print Hi.a | |
1 | |
>>> print Hi.c | |
3 | |
>>> Hi2 = enum('Hi2', 'a b c', bitmask=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDK = /home/tom/src/android-sdk-linux_86 | |
VERSION = 2.0 | |
MANIFEST = AndroidManifest.xml | |
ANDROID_JAR = $(SDK)/platforms/android-$(VERSION)/android.jar | |
RESOURCE_FILE = res.res | |
CLASSPATH = $(ANDROID_JAR):.:/usr/share/java/scala-library.jar | |
AAPT = $(SDK)/platforms/android-$(VERSION)/tools/aapt | |
DEX = $(SDK)/platforms/android-$(VERSION)/tools/dx | |
APKBUILDER = $(SDK)/tools/apkbuilder |
NewerOlder