Minor bug fix for MSSQL connector --tables option

This commit is contained in:
Bernardo Damele 2010-10-19 22:11:17 +00:00
parent 7927e97007
commit 813f44da16

View File

@ -172,12 +172,15 @@ class Dump:
for tables in dbTables.values(): for tables in dbTables.values():
for table in tables: for table in tables:
if isinstance(table, (list, tuple, set)):
table = table[0]
maxlength = max(maxlength, len(table)) maxlength = max(maxlength, len(table))
lines = "-" * (int(maxlength) + 2) lines = "-" * (int(maxlength) + 2)
for db, tables in dbTables.items(): for db, tables in dbTables.items():
tables.sort(key=lambda x: x.lower()) tables.sort()
self.__write("Database: %s" % db) self.__write("Database: %s" % db)
@ -189,6 +192,9 @@ class Dump:
self.__write("+%s+" % lines) self.__write("+%s+" % lines)
for table in tables: for table in tables:
if isinstance(table, (list, tuple, set)):
table = table[0]
blank = " " * (maxlength - len(table)) blank = " " * (maxlength - len(table))
self.__write("| %s%s |" % (table, blank)) self.__write("| %s%s |" % (table, blank))