Exit programm after critical problem

This commit is contained in:
Yorick Barbanneau 2022-04-17 23:58:57 +02:00
parent 18c246ee92
commit 04b45eb412

View file

@ -120,17 +120,20 @@ if __name__ == '__main__':
if not os.path.exists(args.source + '/' + args.states):
logger.critical('can\'t find source file for states')
sys.exit(1)
states = import_states_csv(args.source + '/' + args.states)
logger.debug(states)
if not os.path.exists(args.source + '/' + args.states):
if not os.path.exists(args.source + '/' + args.departments):
logger.critical('can\'t find source file for departments')
sys.exit(1)
departments = import_department_csv(args.source + '/' + args.departments)
logger.debug(departments)
if not os.path.exists(args.source + '/' + args.towns):
logger.critical('can\'t find source file for departments')
sys.exit(1)
towns = import_towns_csv(args.source + '/' + args.towns)
logger.debug(towns)