Skip to content

Commit

Permalink
honor ini order
Browse files Browse the repository at this point in the history
  • Loading branch information
lovato committed Apr 9, 2019
1 parent 874aacf commit e8622b9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions hooks4git/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,14 @@ def execute(cmd, files, settings):
# return files
#
#
def ini_as_dict(conf):
d = dict(conf._sections)
for k in d:
d[k] = dict(conf._defaults, **d[k])
d[k].pop('__name__', None)
return d


# def ini_as_dict(conf):
# d = dict(conf._sections)
# for k in d:
# d[k] = dict(conf._defaults, **d[k])
# d[k].pop('__name__', None)
# return d


def main(cmd):
Expand All @@ -285,7 +287,8 @@ def main(cmd):
exception_message = ""
try:
config.read(configfile)
cfg = ini_as_dict(config)
cfg = dict(config._sections)
# cfg = ini_as_dict(config)
except Exception as e: # noqa
exception_message = str(e)

Expand Down

0 comments on commit e8622b9

Please sign in to comment.