diff --git a/weboob/tools/application/formatters/table.py b/weboob/tools/application/formatters/table.py index 88903612..86d59844 100644 --- a/weboob/tools/application/formatters/table.py +++ b/weboob/tools/application/formatters/table.py @@ -77,6 +77,9 @@ class TableFormatter(IFormatter): s += table.get_html_string() else: s += table.get_string() + + self.queue = [] + if self.return_only: return s else: diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index e6597b24..56640e81 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -303,16 +303,19 @@ class ReplApplication(Cmd, ConsoleApplication): self.set_formatter(formatter_name) try: - return super(ReplApplication, self).onecmd(line) - except CallErrors, e: - self.bcall_errors_handler(e) - except BackendNotGiven, e: - print >>sys.stderr, 'Error: %s' % str(e) - except NotEnoughArguments, e: - print >>sys.stderr, 'Error: not enough arguments. %s' % str(e) - except (KeyboardInterrupt, EOFError): - # ^C during a command process doesn't exit application. - print '\nAborted.' + try: + return super(ReplApplication, self).onecmd(line) + except CallErrors, e: + self.bcall_errors_handler(e) + except BackendNotGiven, e: + print >>sys.stderr, 'Error: %s' % str(e) + except NotEnoughArguments, e: + print >>sys.stderr, 'Error: not enough arguments. %s' % str(e) + except (KeyboardInterrupt, EOFError): + # ^C during a command process doesn't exit application. + print '\nAborted.' + finally: + self.flush() def emptyline(self): """