projects
/
zzz-pokedex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4fac129
)
Print progress for dropping/creating tables
author
Petr Viktorin
<encukou@gmail.com>
Tue, 29 Mar 2011 14:36:45 +0000
(17:36 +0300)
committer
Petr Viktorin
<encukou@gmail.com>
Tue, 29 Mar 2011 14:42:59 +0000
(17:42 +0300)
pokedex/db/load.py
patch
|
blob
|
history
diff --git
a/pokedex/db/load.py
b/pokedex/db/load.py
index
4512bf6
..
a6e9d4a
100644
(file)
--- a/
pokedex/db/load.py
+++ b/
pokedex/db/load.py
@@
-140,12
+140,16
@@
def load(session, tables=[], directory=None, drop_tables=False, verbose=False, s
# Drop all tables if requested
if drop_tables:
print_start('Dropping tables')
# Drop all tables if requested
if drop_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()
# Okay, run through the tables and actually load the data now
connection = session.connection()
# Okay, run through the tables and actually load the data now