From 477c298131c314ba27302c6b535ed5225b3fd99b Mon Sep 17 00:00:00 2001 From: Christophe Benz Date: Fri, 14 May 2010 00:44:27 +0200 Subject: [PATCH] print backtraces --- weboob/frontends/boobank/boobank.py | 43 +++++++++++------------- weboob/frontends/qvideoob/main_window.py | 3 +- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/weboob/frontends/boobank/boobank.py b/weboob/frontends/boobank/boobank.py index e5de9094..5bde97ac 100644 --- a/weboob/frontends/boobank/boobank.py +++ b/weboob/frontends/boobank/boobank.py @@ -2,23 +2,20 @@ # -*- coding: utf-8 -*- # vim: ft=python et softtabstop=4 cinoptions=4 shiftwidth=4 ts=4 ai -""" -Copyright(C) 2009-2010 Romain Bignon, Christophe Benz - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -""" +# Copyright(C) 2009-2010 Romain Bignon, Christophe Benz +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. from __future__ import with_statement @@ -46,12 +43,12 @@ class Boobank(ConsoleApplication): try: for backend, account in self.weboob.do('iter_accounts'): print self.format(account) - except weboob.CallErrors, e: - for backend, error in e.errors: + except weboob.CallErrors, errors: + for backend, error, backtrace in errors: if isinstance(error, weboob.tools.browser.BrowserIncorrectPassword): logging.error(u'Error: Incorrect password for backend %s' % backend.name) else: - logging.error(u'Error[%s]: %s' % (backend.name, error)) + logging.error(u'Error[%s]: %s\n%s' % (backend.name, error, backtrace)) @ConsoleApplication.command('Display all future operations') def command_coming(self, id): @@ -65,9 +62,9 @@ class Boobank(ConsoleApplication): for backend, operation in self.weboob.do(do): print self.format(operation) total += operation.amount - except weboob.CallErrors, e: - for backend, error in e.errors: + except weboob.CallErrors, errors: + for backend, error, backtrace in errors: if isinstance(error, AccountNotFound): logging.error(u'Error: account %s not found' % id) else: - logging.error(u'Error[%s]: %s' % (backend.name, error)) + logging.error(u'Error[%s]: %s\n%s' % (backend.name, error, backtrace)) diff --git a/weboob/frontends/qvideoob/main_window.py b/weboob/frontends/qvideoob/main_window.py index cedd415f..98eeef76 100644 --- a/weboob/frontends/qvideoob/main_window.py +++ b/weboob/frontends/qvideoob/main_window.py @@ -86,8 +86,9 @@ class MainWindow(QtMainWindow): self.emit(SIGNAL('newData'), backend, video) - def eb(backend, err): + def eb(backend, err, backtrace): print err + print backtrace backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString()) if backend_name: