Change create_* functions name to import*
This commit is contained in:
parent
3ec1a6963f
commit
608392ad06
1 changed files with 6 additions and 6 deletions
12
create_db.py
12
create_db.py
|
@ -57,7 +57,7 @@ def parse_args():
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def create_states_csv(raw_file):
|
def import_states_csv(raw_file):
|
||||||
"""
|
"""
|
||||||
Process states raw file
|
Process states raw file
|
||||||
"""
|
"""
|
||||||
|
@ -68,7 +68,7 @@ def create_states_csv(raw_file):
|
||||||
return states
|
return states
|
||||||
|
|
||||||
|
|
||||||
def create_department_csv(raw_file):
|
def import_department_csv(raw_file):
|
||||||
"""
|
"""
|
||||||
Process department files
|
Process department files
|
||||||
"""
|
"""
|
||||||
|
@ -79,7 +79,7 @@ def create_department_csv(raw_file):
|
||||||
return dep
|
return dep
|
||||||
|
|
||||||
|
|
||||||
def create_towns_csv(raw_file):
|
def import_towns_csv(raw_file):
|
||||||
"""
|
"""
|
||||||
Process department files
|
Process department files
|
||||||
"""
|
"""
|
||||||
|
@ -105,17 +105,17 @@ if __name__ == '__main__':
|
||||||
if not os.path.exists(args.source + '/' + args.states):
|
if not os.path.exists(args.source + '/' + args.states):
|
||||||
logger.critical('can\'t find source file for states')
|
logger.critical('can\'t find source file for states')
|
||||||
|
|
||||||
states = create_states_csv(args.source + '/' + args.states)
|
states = import_states_csv(args.source + '/' + args.states)
|
||||||
print(states)
|
print(states)
|
||||||
|
|
||||||
if not os.path.exists(args.source + '/' + args.states):
|
if not os.path.exists(args.source + '/' + args.states):
|
||||||
logger.critical('can\'t find source file for departments')
|
logger.critical('can\'t find source file for departments')
|
||||||
departments = create_department_csv(args.source + '/' + args.departments)
|
departments = import_department_csv(args.source + '/' + args.departments)
|
||||||
print(departments)
|
print(departments)
|
||||||
|
|
||||||
if not os.path.exists(args.source + '/' + args.towns):
|
if not os.path.exists(args.source + '/' + args.towns):
|
||||||
logger.critical('can\'t find source file for departments')
|
logger.critical('can\'t find source file for departments')
|
||||||
towns = create_towns_csv(args.source + '/' + args.towns)
|
towns = import_towns_csv(args.source + '/' + args.towns)
|
||||||
print(towns)
|
print(towns)
|
||||||
|
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue