fix loading config when passed on the command line

pull/54/head
Cereal Killer 9 years ago
parent c15365f93e
commit f1da5974f0

@ -45,12 +45,13 @@ parser.add_argument(
) )
args = parser.parse_args() args = parser.parse_args()
config = None
if args.config: if args.config:
config.read(args.config) config_file = args.config
else: else:
with open('shreddit.yml', 'r') as fh: config_file = 'shreddit.yml'
config = yaml.safe_load(fh)
with open(config_file, 'r') as fh:
config = yaml.safe_load(fh)
if config is None: if config is None:
raise Exception("No config options passed!") raise Exception("No config options passed!")

Loading…
Cancel
Save