From 161320b3bcced3adfa1b80465d36915068973b98 Mon Sep 17 00:00:00 2001 From: OLeonardoRodrigues Date: Mon, 18 Jul 2022 22:58:18 -0300 Subject: [PATCH] fix dft path for config --- src/parse_config.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/parse_config.py b/src/parse_config.py index c12412e..2571456 100644 --- a/src/parse_config.py +++ b/src/parse_config.py @@ -2,13 +2,16 @@ from os import path, environ def parse_config(): - filename = path.abspath(environ.get('CONFIG_FILE')) + try: + filename = path.abspath(environ.get('CONFIG_FILE')) + except: + filename = '.repo-keeper' topics = parse_topics(filename=filename) options = parse_options(filename=filename) return(topics, options) -def parse_topics(filename=path.abspath('.repo-keeper'), section='topics'): +def parse_topics(filename, section='topics'): topics = "" parser = ConfigParser(allow_no_value=True) parser.read(filename) @@ -20,7 +23,7 @@ def parse_topics(filename=path.abspath('.repo-keeper'), section='topics'): return(topics) -def parse_options(filename=path.abspath('.repo-keeper'), section='options'): +def parse_options(filename, section='options'): options = {} parser = ConfigParser(allow_no_value=True) parser.read(filename)