From fbe0fb8d52573294a8b514fe5cc891a259d93db5 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Fri, 15 Mar 2013 22:31:33 +0100 Subject: [PATCH] Some manual style fixes --- modules/aum/captcha.py | 3 ++- modules/bnporc/perso/transactions.py | 6 ++++-- modules/bp/pages/accountlist.py | 2 +- modules/dlfp/pages/index.py | 2 +- modules/okc/backend.py | 2 +- modules/opacwebaloes/browser.py | 2 +- weboob/applications/masstransit/masstransit.py | 2 +- weboob/applications/qcineoob/main_window.py | 3 ++- weboob/core/ouiboube.py | 4 ++-- weboob/tools/application/media_player.py | 6 +++--- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/aum/captcha.py b/modules/aum/captcha.py index 44683a95..0f0c9ee7 100644 --- a/modules/aum/captcha.py +++ b/modules/aum/captcha.py @@ -27,7 +27,8 @@ except ImportError: raise ImportError('Please install python-imaging') -class CaptchaError(Exception): pass +class CaptchaError(Exception): + pass class Tile(object): diff --git a/modules/bnporc/perso/transactions.py b/modules/bnporc/perso/transactions.py index bdf1ca8c..3033d877 100644 --- a/modules/bnporc/perso/transactions.py +++ b/modules/bnporc/perso/transactions.py @@ -74,8 +74,10 @@ class AccountHistory(BasePage): text = tds[1].text or u'' text = text.replace(u'\xa0', u'') for child in tds[1].getchildren(): - if child.text: text += child.text - if child.tail: text += child.tail + if child.text: + text += child.text + if child.tail: + text += child.tail i += 1 operation = Transaction(i) diff --git a/modules/bp/pages/accountlist.py b/modules/bp/pages/accountlist.py index aa9d7a3e..5a859d35 100644 --- a/modules/bp/pages/accountlist.py +++ b/modules/bp/pages/accountlist.py @@ -48,7 +48,7 @@ class AccountList(BasePage): return lines = tables[0].xpath(".//tbody/tr") - for line in lines: + for line in lines: account = Account() tmp = line.xpath("./td//a")[0] account.label = to_unicode(tmp.text) diff --git a/modules/dlfp/pages/index.py b/modules/dlfp/pages/index.py index 227f768f..46d9097d 100644 --- a/modules/dlfp/pages/index.py +++ b/modules/dlfp/pages/index.py @@ -35,7 +35,7 @@ class IndexPage(DLFPPage): form = self.parser.select(self.document.getroot(), 'form#new_account_sidebar', 1) for i in form.find('div').getiterator('input'): if i.attrib['name'] == 'authenticity_token': - return i.attrib['value'] + return i.attrib['value'] class LoginPage(DLFPPage): diff --git a/modules/okc/backend.py b/modules/okc/backend.py index 2e7fd3cf..765a44f8 100644 --- a/modules/okc/backend.py +++ b/modules/okc/backend.py @@ -43,7 +43,7 @@ def parse_dt(s): now = datetime.datetime.now() if s is None: return local2utc(now) - if 'minutes ago' in s: + if 'minutes ago' in s: m = int(s.split()[0]) d = now - datetime.timedelta(minutes=m) elif u'–' in s: diff --git a/modules/opacwebaloes/browser.py b/modules/opacwebaloes/browser.py index bb33d44a..79698fab 100644 --- a/modules/opacwebaloes/browser.py +++ b/modules/opacwebaloes/browser.py @@ -58,7 +58,7 @@ class AloesBrowser(BaseBrowser): self.location('%s://%s/index.aspx' % (self.PROTOCOL, self.BASEURL), no_login=True) - if not self.page.login(self.username, self.password) or \ + if not self.page.login(self.username, self.password) or \ not self.is_logged() or \ (self.is_on_page(LoginPage) and self.page.is_error()): raise BrowserIncorrectPassword() diff --git a/weboob/applications/masstransit/masstransit.py b/weboob/applications/masstransit/masstransit.py index 5f75687a..b16c15c0 100644 --- a/weboob/applications/masstransit/masstransit.py +++ b/weboob/applications/masstransit/masstransit.py @@ -60,7 +60,7 @@ class MasstransitHildon(): status = event.get_status() if status == conic.STATUS_CONNECTED: self.connected = True - if self.touch_selector_entry_filled == False: + if not self.touch_selector_entry_filled: debug("connected, now fill") self.fill_touch_selector_entry() if self.refresh_in_progress: diff --git a/weboob/applications/qcineoob/main_window.py b/weboob/applications/qcineoob/main_window.py index e4c6dce4..f23965e2 100644 --- a/weboob/applications/qcineoob/main_window.py +++ b/weboob/applications/qcineoob/main_window.py @@ -17,7 +17,8 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -import os,codecs +import os +import codecs from PyQt4.QtCore import SIGNAL, Qt, QStringList from PyQt4.QtGui import QApplication, QCompleter diff --git a/weboob/core/ouiboube.py b/weboob/core/ouiboube.py index 9f75faaa..f3b1f3fb 100644 --- a/weboob/core/ouiboube.py +++ b/weboob/core/ouiboube.py @@ -325,7 +325,7 @@ class Weboob(object): if len(_backends) > 0: try: backends = [self.backend_instances[_backends]] - except (ValueError,KeyError): + except (ValueError, KeyError): backends = [] elif isinstance(_backends, (list, tuple, set)): backends = [] @@ -333,7 +333,7 @@ class Weboob(object): if isinstance(backend, basestring): try: backends.append(self.backend_instances[backend]) - except (ValueError,KeyError): + except (ValueError, KeyError): pass else: backends.append(backend) diff --git a/weboob/tools/application/media_player.py b/weboob/tools/application/media_player.py index 4e068c35..81bdfd70 100644 --- a/weboob/tools/application/media_player.py +++ b/weboob/tools/application/media_player.py @@ -112,7 +112,7 @@ class MediaPlayer(object): media_url = media.url try: player_url = media.swf_player - if media.swf_player: + if media.swf_player: rtmp = 'rtmpdump -r %s --swfVfy %s' % (media_url, player_url) else: rtmp = 'rtmpdump -r %s' % media_url @@ -123,7 +123,7 @@ class MediaPlayer(object): rtmp += ' --quiet' - if args is None : + if args is None: for (binary, stdin_args) in PLAYERS: if binary == player_name: args = stdin_args @@ -139,7 +139,7 @@ class MediaPlayer(object): p1 = Popen(rtmp.split(), stdout=PIPE) Popen(player_name + args, stdin=p1.stdout, stderr=PIPE) - def _find_in_path(self,path, filename): + def _find_in_path(self, path, filename): for i in path.split(':'): if os.path.exists('/'.join([i, filename])): return True