From 601e78bea1a2a787995002518139af696ce4b515 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Thu, 6 Nov 2008 13:06:25 -0500 Subject: [PATCH] Separate table generation from printing in runalyzer. --- src/runalyzer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runalyzer.py b/src/runalyzer.py index 0481adb..7110fdb 100644 --- a/src/runalyzer.py +++ b/src/runalyzer.py @@ -116,13 +116,16 @@ class RunDB(object): if self.interactive: show() - def print_cursor(self, cursor): + def table_from_cursor(self, cursor): from pytools import Table tbl = Table() tbl.add_row([column[0] for column in cursor.description]) for row in cursor: tbl.add_row(row) - print tbl + return tbl + + def print_cursor(self, cursor): + print self.table_from_cursor(cursor) -- GitLab