- commit
- f7a0e9ec32f448d3047d92cb5b291d78600f70a0
- parent
- cad0af6e4d38e5d48fd1a00da090eabf73695f37
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2015-03-22 14:57
allow to pass a config file to cli
Diffstat
| M | projects.py | 9 | ++++++--- |
1 files changed, 6 insertions, 3 deletions
diff --git a/projects.py b/projects.py
@@ -303,8 +303,8 @@ def get_travis(url): 303 303 } 304 304 305 305306 -1 def load_config():307 -1 with open('projects.yml') as fh:-1 306 def load_config(path): -1 307 with open(path) as fh: 308 308 return yaml.load(fh) 309 309 310 310 @@ -320,6 +320,9 @@ def parse_args(): 320 320 action='store_true', 321 321 help='show only basic stats') 322 322 parser.add_argument( -1 323 '-c', '--config', -1 324 default='projects.yml') -1 325 parser.add_argument( 323 326 '-S', '--show-sources', 324 327 action='store_true', 325 328 help='show a source for each claim') @@ -329,7 +332,7 @@ def parse_args(): 329 332 330 333 def main(): 331 334 args = parse_args()332 -1 config = load_config()-1 335 config = load_config(os.path.expanduser(args.config)) 333 336 334 337 keys = config['projects'].keys() 335 338 if args.query is not None: