diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-26 22:08:24 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-26 22:08:24 -0500 |
commit | 7267a700f881980c852502e8b1ce51abceebafcd (patch) | |
tree | 143c6e90f1bd525cc7b60a02968abfabde91bb2e /server.py | |
parent | 7346a9410f4711be901f6fd22952c004543e8a4c (diff) | |
download | bbj-7267a700f881980c852502e8b1ce51abceebafcd.tar.gz |
add new host options for server and urwid client
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -520,5 +520,16 @@ if __name__ == "__main__": except IndexError: # flag given but no value exit("thats not how this works, silly! --port 7099") - cherrypy.config.update({'server.socket_port': int(port)}) + try: + host_spec = argv.index("--host") + host = argv[host_spec+1] + except ValueError: # --host not specified + host = "127.0.0.1" + except IndexError: # flag given but no value + exit("thats not how this works, silly! --host 127.0.0.1") + + cherrypy.config.update({ + "server.socket_port": int(port), + "server.socket_host": host + }) run() |