@repl_command<EOL><INDENT>def do_ls(self, table=None):<DEDENT>
if table is None:<EOL><INDENT>fields = OrderedDict(<EOL>[<EOL>("<STR_LIT:Name>", "<STR_LIT:name>"),<EOL>("<STR_LIT>", "<STR_LIT:status>"),<EOL>("<STR_LIT>", "<STR_LIT>"),<EOL>("<STR_LIT>", "<STR_LIT>"),<EOL>]<EOL>)<EOL>tables = self.engine.describe_all()<EOL>sizes = [<EOL><NUM_LIT:1> + max([len(str(getattr(t, f))) for t in tables] + [len(title)])<EOL>for title, f in iteritems(fields)<EOL>]<EOL>for size, title in zip(sizes, fields):<EOL><INDENT>print(title.ljust(size), end="<STR_LIT>")<EOL><DEDENT>print()<EOL>for row_table in tables:<EOL><INDENT>for size, field in zip(sizes, fields.values()):<EOL><INDENT>print(str(getattr(row_table, field)).ljust(size), end="<STR_LIT>")<EOL><DEDENT>print()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print(self.engine.describe(table, refresh=True, metrics=True).pformat())<EOL><DEDENT>
List all tables or print details of one table