diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-10-02 10:59:34 +0200 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2014-10-02 10:59:34 +0200 |
commit | 9b48cf1a85ced79a22a8668e2da3a84947c4e97c (patch) | |
tree | d49f5bce93b4a54ea9f983f725ffe70ccf8ca6f2 /service/pixelated | |
parent | effec78faacc4def3cd1f1f7fbedf79eaeb824f5 (diff) |
Added config file command line parameter to user agent.
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/user_agent.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/service/pixelated/user_agent.py b/service/pixelated/user_agent.py index 8c7440b0..bee0035b 100644 --- a/service/pixelated/user_agent.py +++ b/service/pixelated/user_agent.py @@ -185,17 +185,20 @@ def start_user_agent(debug_enabled): def setup(): try: + default_config_path = os.path.join(os.environ['HOME'], '.pixelated') + parser = argparse.ArgumentParser(description='Pixelated user agent.') parser.add_argument('--debug', action='store_true', help='DEBUG mode.') parser.add_argument('--register', metavar='username', help='register user with name.') + parser.add_argument('-c', '--config', metavar='configfile', default=default_config_path, help='use specified config file. Default is ~/.pixelated.') args = parser.parse_args() debug_enabled = args.debug or os.environ.get('DEBUG', False) reactor_manager.start_reactor(logging=debug_enabled) crochet.setup() - app.config.from_pyfile(os.path.join(os.environ['HOME'], '.pixelated')) + app.config.from_pyfile(args.config) if args.register: register_new_user(args.register) |