Exit programm after critical problem
This commit is contained in:
parent
18c246ee92
commit
04b45eb412
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue