blob: ec0c322016ceefd53b67f5c13dd5346630f7fbdc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
def helper(wsgiServerClass, global_conf, host, port, **local_conf):
# I think I can't write a tuple for bindAddress in .ini file
host = host or global_conf.get('host', 'localhost')
port = port or global_conf.get('port', 4000)
if 'socket' in local_conf:
local_conf['bindAddress'] = local_conf['socket']
del local_conf['socket']
if 'umask' in local_conf:
local_conf['umask'] = int(local_conf['umask'], 8)
else:
local_conf['bindAddress'] = (host, int(port))
def server(application):
server = wsgiServerClass(application, **local_conf)
server.run()
return server
|