Merge pull request #54 from cereal-killer/master

fix loading config when passed on the command line
pull/60/head
Nay 9 years ago
commit 42ba875bce

@ -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