mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Print progress for dropping/creating tables
This commit is contained in:
parent
bb4861b8c6
commit
3475c86d2e
1 changed files with 6 additions and 2 deletions
|
@ -140,12 +140,16 @@ def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s
|
||||||
# Drop all tables if requested
|
# Drop all tables if requested
|
||||||
if drop_tables:
|
if drop_tables:
|
||||||
print_start('Dropping tables')
|
print_start('Dropping tables')
|
||||||
for table in reversed(table_objs):
|
for n, table in enumerate(reversed(table_objs)):
|
||||||
table.drop(checkfirst=True)
|
table.drop(checkfirst=True)
|
||||||
|
print_status('%s/%s' % (n, len(table_objs)))
|
||||||
print_done()
|
print_done()
|
||||||
|
|
||||||
for table in table_objs:
|
print_start('Creating tables')
|
||||||
|
for n, table in enumerate(table_objs):
|
||||||
table.create()
|
table.create()
|
||||||
|
print_status('%s/%s' % (n, len(table_objs)))
|
||||||
|
print_done()
|
||||||
connection = session.connection()
|
connection = session.connection()
|
||||||
|
|
||||||
# Okay, run through the tables and actually load the data now
|
# Okay, run through the tables and actually load the data now
|
||||||
|
|
Loading…
Reference in a new issue