From a32dfeb412ddd6171a6ae0abed254a55e92b99f9 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 9 Dec 2011 21:32:44 +0100 Subject: [PATCH 1/2] fix formatting error --- weboob/applications/radioob/radioob.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weboob/applications/radioob/radioob.py b/weboob/applications/radioob/radioob.py index ecfb6df3..35c39dae 100644 --- a/weboob/applications/radioob/radioob.py +++ b/weboob/applications/radioob/radioob.py @@ -92,7 +92,7 @@ class Radioob(ReplApplication): radio = self.get_object(_id, 'get_radio', ['streams']) if not radio: - print >>sys.stderr, 'Radio not found: ' % _id + print >>sys.stderr, 'Radio not found:', _id return 1 try: player_name = self.config.get('media_player') From 4edeba3d62f02d33ae006b957eea58678bfb26d9 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Mon, 12 Dec 2011 14:37:24 +0100 Subject: [PATCH 2/2] fix crash when there isn't any photos on a profile --- weboob/applications/qhavesex/contacts.py | 4 ++++ weboob/tools/browser/browser.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/weboob/applications/qhavesex/contacts.py b/weboob/applications/qhavesex/contacts.py index 63d1e176..c102d1bc 100644 --- a/weboob/applications/qhavesex/contacts.py +++ b/weboob/applications/qhavesex/contacts.py @@ -300,10 +300,14 @@ class ContactProfile(QWidget): logging.warning('Not supported widget: %r' % widget) def previousClicked(self): + if len(self.contact.photos) == 0: + return self.displayed_photo_idx = (self.displayed_photo_idx - 1) % len(self.contact.photos) self.display_photo() def nextClicked(self): + if len(self.contact.photos) == 0: + return self.displayed_photo_idx = (self.displayed_photo_idx + 1) % len(self.contact.photos) self.display_photo() diff --git a/weboob/tools/browser/browser.py b/weboob/tools/browser/browser.py index 3ccb7d36..60b2e445 100644 --- a/weboob/tools/browser/browser.py +++ b/weboob/tools/browser/browser.py @@ -230,7 +230,8 @@ class StandardBrowser(mechanize.Browser): else: return None except (mechanize.BrowserStateError, BrowserRetry): - self.home() + if hasattr(self, 'home'): + self.home() return mechanize.Browser.open(self, *args, **kwargs) def get_exception(self, e):