Skip to content

Commit

Permalink
Fix INI file reader
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Friedrich committed Jun 11, 2022
1 parent 5d56485 commit 622184b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .python-version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
3.9.12
3.10.4
3.9.13
3.10.5
6 changes: 3 additions & 3 deletions audiorename/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def read_config_file(file_path) -> ArgsDefault:
for option in config.options(section):
options[option] = config.get(section, option)

for k, v in vars(args).items():
if k in options:
setattr(args, k, v)
for attr in dir(args):
if '__' not in attr and attr in options:
setattr(args, attr, options[attr])

return args
2 changes: 1 addition & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TestConfig(unittest.TestCase):

def test_read_config(self):
args = read_config_file('example-config.ini')
# self.assertEquals(args.backup_folder, '/tmp/backup')
self.assertEquals(args.backup_folder, '/tmp/backup')


if __name__ == '__main__':
Expand Down

0 comments on commit 622184b

Please sign in to comment.