From c5e4e9b0d6d1564cd98a50be4ffd2c95c6301a25 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 29 Mar 2011 17:36:45 +0300 Subject: [PATCH] Print progress for dropping/creating tables --- pokedex/db/load.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pokedex/db/load.py b/pokedex/db/load.py index 4512bf6..a6e9d4a 100644 --- 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') - for table in reversed(table_objs): + for n, table in enumerate(reversed(table_objs)): table.drop(checkfirst=True) + print_status('%s/%s' % (n, len(table_objs))) print_done() - for table in table_objs: + print_start('Creating tables') + for n, table in enumerate(table_objs): 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 -- 2.7.4