diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2015-10-31 08:59:26 +0000 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2015-10-31 08:59:26 +0000 |
commit | 34446226d157de724f8442f1d05742f9104d68e9 (patch) | |
tree | 2bd01573d6c74c5834a033d09abad37ae56646e1 /kbas | |
parent | 23a5d4df073c6b9c0d0251ca280acfe6703e10ad (diff) | |
download | ybd-34446226d157de724f8442f1d05742f9104d68e9.tar.gz |
Kbas should use cherrypy if it is installed
Diffstat (limited to 'kbas')
-rwxr-xr-x | kbas/__main__.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/kbas/__main__.py b/kbas/__main__.py index 6a7e1fb..e486bff 100755 --- a/kbas/__main__.py +++ b/kbas/__main__.py @@ -43,12 +43,19 @@ class KeyedBinaryArtifactServer(object): os.path.join(os.path.dirname(__file__), 'config', 'kbas.conf')]) app.config['start-time'] = datetime.datetime.now() + try: + import cherrypy + server = 'cherrypy' + except: + server = 'wsgiref' + # for development: if app.config.get('mode') == 'development': - bottle.run(host=app.config['host'], port=app.config['port'], - debug=True, reloader=True) + bottle.run(server=server, host=app.config['host'], + port=app.config['port'], debug=True, reloader=True) else: - bottle.run(host=app.config['host'], port=app.config['port']) + bottle.run(server=server, host=app.config['host'], + port=app.config['port'], reloader=True) @bottle.get('/static/<filename>') def send_static(filename): |