Skip to content

Commit

Permalink
fix dft path for config
Browse files Browse the repository at this point in the history
  • Loading branch information
OLeonardoRodrigues committed Jul 19, 2022
1 parent 991c0a2 commit 161320b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/parse_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 161320b

Please sign in to comment.