diff --git a/twoot.py b/twoot.py index 47fe99d..ce0813b 100755 --- a/twoot.py +++ b/twoot.py @@ -346,7 +346,8 @@ def main(argv): } # Default empty toml - toml = {'config': {}, 'options': options} + # toml = {'config': {}, 'options': options} + toml = {} # Load config file if it was provided toml_file = args['f'] @@ -354,7 +355,7 @@ def main(argv): import tomli try: with open(toml_file, 'rb') as config_file: - toml = tomli.read(config_file) + toml = tomli.load(config_file) except FileNotFoundError: print('config file not found') exit(-1) @@ -362,6 +363,8 @@ def main(argv): print('Malformed config file') exit(-1) + print(toml) + # Override config file parameter values with command-line values if provided if args['t'] is not None: toml['config']['twitter_account'] = args['t']