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/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') 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):