<s> import chefdash <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import geventwebsocket . handler <EOL> import gevent . pywsgi <EOL> import logging <EOL> import sys <EOL> if len ( sys . argv ) > <NUM_LIT:1> : <EOL> chefdash . app . config . from_pyfile ( sys . argv [ <NUM_LIT:1> ] ) <EOL> host = '<STR_LIT>' <EOL> port = <NUM_LIT> <EOL> server_name = chefdash . app . config . get ( '<STR_LIT>' ) <EOL> if server_name is not None and '<STR_LIT::>' in server_name : <EOL> server_name = server_name . split ( '<STR_LIT::>' ) <EOL> host = server_name [ <NUM_LIT:0> ] <EOL> port = int ( server_name [ <NUM_LIT:1> ] ) <EOL> log = '<STR_LIT:default>' <EOL> if not chefdash . app . debug : <EOL> log = None <EOL> filename = chefdash . app . config [ '<STR_LIT>' ] <EOL> if filename : <EOL> handler = logging . FileHandler ( filename ) <EOL> handler . setLevel ( chefdash . app . config [ '<STR_LIT>' ] ) <EOL> formatter = logging . Formatter ( chefdash . app . config [ '<STR_LIT>' ] ) <EOL> handler . setFormatter ( formatter ) <EOL> chefdash . app . logger . setLevel ( chefdash . app . config [ '<STR_LIT>' ] ) <EOL> chefdash . app . logger . addHandler ( handler ) <EOL> chefdash . app . logger . info ( '<STR_LIT>' % ( host , port ) ) <EOL> server = gevent . pywsgi . WSGIServer ( ( host , port ) , chefdash . handler , handler_class = geventwebsocket . handler . WebSocketHandler , log = log ) <EOL> server . serve_forever ( ) </s>
