Skip to content

Commit

Permalink
Merge pull request #1 from azureswastika/fix
Browse files Browse the repository at this point in the history
Fix dash bug
  • Loading branch information
tdeni committed Nov 30, 2020
2 parents 4a9c55f + 87efda0 commit 5222e5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion myconfig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .cli import main
from .main import MyConfig

__version__ = '0.2.2'
__version__ = '0.2.3'
14 changes: 11 additions & 3 deletions myconfig/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def parser(files: list = None) -> dict:
dict: Parsed data.
'''
data = dict()
if ENV.exists():
env_data = env_parse(ENV)
data.update(env_data)
if files:
for i, file in enumerate(files):
files[i] = str(DIR.joinpath(file))
Expand All @@ -56,9 +59,14 @@ def parser(files: list = None) -> dict:
'File not found. ' +
'Specify the correct path to the file: {}'.format(
file.split('\\')[-1]))
if ENV.exists():
env_data = env_parse(ENV)
data.update(env_data)
_ = [dict(), list()]
for key in data:
if '-' in key:
_[1].append(key)
_[0].update({key.replace('-', '_'): data[key]})
data.update(_[0])
for item in _[1]:
data.pop(item)
return data


Expand Down

0 comments on commit 5222e5f

Please sign in to comment.