- commit
- eba025c9e0ef97bd71014c5469c8fec80f9b64de
- parent
- a2c116d3bd9c515ffb3765d4b14f48318c5e9b60
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2015-02-05 17:27
Revert "load config from local and home" This reverts commit 8d29fede8e07a093ca028d82d7b2a5a6b7ae8b9a.
Diffstat
| M | jsonproxy/__init__.py | 16 | ++-------------- |
1 files changed, 2 insertions, 14 deletions
diff --git a/jsonproxy/__init__.py b/jsonproxy/__init__.py
@@ -37,33 +37,21 @@ def check_config(config): 37 37 38 38 def main(): 39 39 parser = argparse.ArgumentParser(description='simple proxy and scraper')40 -1 parser.add_argument('-c', '--config')-1 40 parser.add_argument('config') 41 41 parser.add_argument('-d', '--debug', action='store_true') 42 42 parser.add_argument('-p', '--port', type=int) 43 43 parser.add_argument('-H', '--host') 44 44 args = parser.parse_args() 45 45 46 46 app = Flask(__name__) -1 47 app.config.from_pyfile(os.path.abspath(args.config)) 47 4848 -1 # load config49 -1 config_files = [50 -1 os.path.expanduser('~/.config/pyjsonproxy.cfg'),51 -1 os.path.abspath('.pyjsonproxy.cfg'),52 -1 ]53 -1 for path in config_files:54 -1 if os.path.exists(path):55 -1 app.config.from_pyfile(path)56 -1 if args.config is not None:57 -1 app.config.from_pyfile(os.path.abspath(args.config))58 -159 -1 # check for config errors60 49 errors = check_config(app.config) 61 50 if errors: 62 51 for error in errors: 63 52 app.logger.error(error) 64 53 sys.exit(1) 65 5466 -1 # run67 55 app.register_blueprint(api) 68 56 app.run(host=args.host, port=args.port, debug=args.debug) 69 57