From ff3fa257a62e03bd0032cdf32398c5b23803d1c1 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 13 2016 12:34:22 +0000 Subject: [PATCH 1/3] Fix specifying a configuration file in the runserver --- diff --git a/runserver.py b/runserver.py index dea56b0..713c407 100755 --- a/runserver.py +++ b/runserver.py @@ -22,8 +22,15 @@ parser.add_argument( args = parser.parse_args() +if args.config: + config = args.config + if not config.startswith('/'): + here = os.path.join(os.path.dirname(os.path.abspath(__file__))) + config = os.path.join(here, config) + os.environ['HUBS_CONFIG'] = config + + from hubs.app import app app.debug = True -app.config.from_object(args.config) app.run(debug=True, host=args.host, port=int(args.port)) From 87c976403ce74597fcf2102687044961b7fb743a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 13 2016 14:05:09 +0000 Subject: [PATCH 2/3] Adjust the help message for the config CLI argument --- diff --git a/runserver.py b/runserver.py index 713c407..9d4ece9 100755 --- a/runserver.py +++ b/runserver.py @@ -16,8 +16,8 @@ parser.add_argument( localhost') parser.add_argument( '--config', '-c', - help='The configuration file to load from. Defaults to hubs.default_config. \ - Write the config file name in object form. For example: hubs.my_config') + help='A configuration file to load (alloing to override the default ' + 'configuraton)') args = parser.parse_args() From 55bb069804fe31d7b5bf6936debf33b605fbd6aa Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 13 2016 14:06:34 +0000 Subject: [PATCH 3/3] Typi, typo --- diff --git a/runserver.py b/runserver.py index 9d4ece9..fc2b237 100755 --- a/runserver.py +++ b/runserver.py @@ -16,7 +16,7 @@ parser.add_argument( localhost') parser.add_argument( '--config', '-c', - help='A configuration file to load (alloing to override the default ' + help='A configuration file to load (allowing to override the default ' 'configuraton)')