pep8 blank lines fixes
flake8 --select W391,E302,E301,E304 autopep8 can't fix W391 even though it claims it can. Fixed using a simple custom script.
This commit is contained in:
parent
be2c8bd789
commit
448c06d125
83 changed files with 249 additions and 25 deletions
|
|
@ -24,6 +24,7 @@ from .browser import SevenFiftyGramsBrowser
|
|||
|
||||
import unicodedata
|
||||
|
||||
|
||||
def strip_accents(s):
|
||||
return ''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn')
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ from weboob.deprecated.browser import Page
|
|||
class ResultsPage(Page):
|
||||
""" Page which contains results as a list of recipies
|
||||
"""
|
||||
|
||||
def iter_recipes(self):
|
||||
for div in self.parser.select(self.document.getroot(), 'div.recette_description > div.data'):
|
||||
links = self.parser.select(div, 'div.info > p.title > a.fn')
|
||||
|
|
@ -65,6 +66,7 @@ class ResultsPage(Page):
|
|||
class RecipePage(Page):
|
||||
""" Page which contains a recipe
|
||||
"""
|
||||
|
||||
def get_recipe(self, id):
|
||||
title = NotAvailable
|
||||
preparation_time = NotAvailable
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
from weboob.tools.test import BackendTest
|
||||
import re
|
||||
|
||||
|
||||
class AllocineTest(BackendTest):
|
||||
MODULE = 'allocine'
|
||||
|
||||
|
|
|
|||
|
|
@ -60,4 +60,3 @@ class AlloRestoModule(Module, CapBank):
|
|||
|
||||
def iter_coming(self, account):
|
||||
return self.browser.get_coming(account)
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class AccountsPage(LoggedPage, HTMLPage):
|
|||
|
||||
class MyDate(Filter):
|
||||
MONTHS = ['janv', u'févr', u'mars', u'avr', u'mai', u'juin', u'juil', u'août', u'sept', u'oct', u'nov', u'déc']
|
||||
|
||||
def filter(self, txt):
|
||||
day, month, year = txt.split(' ')
|
||||
day = int(day)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class FourOFourPage(Page):
|
|||
class ResultsPage(Page):
|
||||
""" Page which contains results as a list of recipies
|
||||
"""
|
||||
|
||||
def iter_recipes(self):
|
||||
for div in self.parser.select(self.document.getroot(), 'div.recipe-info'):
|
||||
thumbnail_url = NotAvailable
|
||||
|
|
@ -59,6 +60,7 @@ class ResultsPage(Page):
|
|||
class RecipePage(Page):
|
||||
""" Page which contains a recipe
|
||||
"""
|
||||
|
||||
def get_recipe(self, id):
|
||||
title = NotAvailable
|
||||
preparation_time = NotAvailable
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ from weboob.capabilities.bill import Subscription, Detail, Bill
|
|||
# Ugly array to avoid the use of french locale
|
||||
FRENCH_MONTHS = [u'janvier', u'février', u'mars', u'avril', u'mai', u'juin', u'juillet', u'août', u'septembre', u'octobre', u'novembre', u'décembre']
|
||||
|
||||
|
||||
class AmeliBasePage(Page):
|
||||
def is_logged(self):
|
||||
try:
|
||||
|
|
@ -40,6 +41,7 @@ class AmeliBasePage(Page):
|
|||
self.logger.debug('logged: %s' % (logged))
|
||||
return logged
|
||||
|
||||
|
||||
class LoginPage(AmeliBasePage):
|
||||
def login(self, login, password):
|
||||
self.browser.select_form('connexionCompteForm')
|
||||
|
|
@ -47,9 +49,11 @@ class LoginPage(AmeliBasePage):
|
|||
self.browser["connexioncompte_2codeConfidentiel"] = password.encode('utf8')
|
||||
self.browser.submit()
|
||||
|
||||
|
||||
class HomePage(AmeliBasePage):
|
||||
pass
|
||||
|
||||
|
||||
class AccountPage(AmeliBasePage):
|
||||
def iter_subscription_list(self):
|
||||
idents = self.document.xpath('//div[contains(@class, "blocfond")]')
|
||||
|
|
|
|||
|
|
@ -63,4 +63,3 @@ class AmericanExpressModule(Module, CapBank):
|
|||
transactions = list(self.browser.get_history(account))
|
||||
transactions.sort(key=lambda tr: tr.rdate, reverse=True)
|
||||
return transactions
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ class AccountsPage(Page):
|
|||
|
||||
yield a
|
||||
|
||||
|
||||
class TransactionsPage(Page):
|
||||
COL_ID = 0
|
||||
COL_DATE = 1
|
||||
|
|
@ -81,6 +82,7 @@ class TransactionsPage(Page):
|
|||
return datetime.date(int(m.group(3)),
|
||||
self.MONTHS.index(m.group(2).rstrip('.')) + 1,
|
||||
int(m.group(1)))
|
||||
|
||||
def get_beginning_debit_date(self):
|
||||
for option in self.document.xpath('//select[@id="viewPeriod"]/option'):
|
||||
if 'selected' in option.attrib:
|
||||
|
|
|
|||
|
|
@ -39,4 +39,3 @@ class AudioAddictTest(BackendTest):
|
|||
self.assertTrue(radio.current.what)
|
||||
self.assertTrue(radio.streams[0].url)
|
||||
self.assertTrue(radio.streams[0].title)
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ class WebsiteBrowser(LoginBrowser):
|
|||
|
||||
return profile
|
||||
|
||||
|
||||
class AuMBrowser(Browser):
|
||||
DOMAIN = 'www.adopteunmec.com'
|
||||
APIKEY = 'fb0123456789abcd'
|
||||
|
|
|
|||
|
|
@ -256,6 +256,7 @@ class TransactionsPage(BasePage):
|
|||
|
||||
yield t
|
||||
|
||||
|
||||
class CBTransactionsPage(TransactionsPage):
|
||||
COL_CB_CREDIT = 2
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ class VirtKeyboard(MappedVirtKeyboard):
|
|||
code += self.get_symbol_code(self.symbols[c])
|
||||
return code
|
||||
|
||||
|
||||
class LoginPage(HTMLPage):
|
||||
def login(self, login, password):
|
||||
vk = VirtKeyboard(self)
|
||||
|
|
@ -98,6 +99,7 @@ class LoginPage(HTMLPage):
|
|||
form['code'] = code
|
||||
form.submit()
|
||||
|
||||
|
||||
class IndexPage(LoggedPage, HTMLPage):
|
||||
@method
|
||||
class get_list(ListElement):
|
||||
|
|
@ -152,6 +154,7 @@ class IndexPage(LoggedPage, HTMLPage):
|
|||
def get_card_name(self):
|
||||
return CleanText('//h1[1]')(self.doc)
|
||||
|
||||
|
||||
class AccountsPage(LoggedPage, HTMLPage):
|
||||
def get_balance(self):
|
||||
balance = Decimal('0.0')
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ class BanquePopulaire(Browser):
|
|||
self.token = self.page.get_token()
|
||||
|
||||
ACCOUNT_URLS = ['mesComptes', 'mesComptesPRO', 'maSyntheseGratuite', 'accueilSynthese']
|
||||
|
||||
def go_on_accounts_list(self):
|
||||
for taskInfoOID in self.ACCOUNT_URLS:
|
||||
self.location(self.buildurl('/cyber/internet/StartTask.do', taskInfoOID=taskInfoOID, token=self.token))
|
||||
|
|
|
|||
|
|
@ -267,5 +267,6 @@ class HistoryPage(BEPage):
|
|||
# Last page
|
||||
return None
|
||||
|
||||
|
||||
class UnknownPage(BEPage):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ from .login import LoginPage, UpdateInfoPage
|
|||
|
||||
from .two_authentication import AuthenticationPage
|
||||
|
||||
|
||||
class AccountPrelevement(AccountsList):
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class UnavailablePage(Page):
|
|||
def on_loaded(self):
|
||||
raise BrowserUnavailable()
|
||||
|
||||
|
||||
class Keyboard(VirtKeyboard):
|
||||
symbols={'0':'daa52d75287bea58f505823ef6c8b96c',
|
||||
'1':'f5da96c2592803a8cdc5a928a2e4a3b0',
|
||||
|
|
@ -86,6 +87,7 @@ class Keyboard(VirtKeyboard):
|
|||
x1, y1, x2, y2 = coords
|
||||
return VirtKeyboard.get_symbol_coords(self, (x1+3, y1+3, x2-3, y2-3))
|
||||
|
||||
|
||||
class LoginPage(Page):
|
||||
def login(self, login, pwd):
|
||||
vk = Keyboard(self)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from .browser import BTDiggBrowser
|
|||
|
||||
__all__ = ['BTDiggModule']
|
||||
|
||||
|
||||
class BTDiggModule(Module, CapTorrent):
|
||||
NAME = 'btdigg'
|
||||
MAINTAINER = u'Matthieu Rakotojaona'
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class TorrentsPage(Page):
|
|||
torrent.date = date
|
||||
yield torrent
|
||||
|
||||
|
||||
class TorrentPage(Page):
|
||||
def get_torrent(self, id):
|
||||
trs = self.document.getroot().cssselect('table.torrent_info_tbl tr')
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class _LogoutPage(Page):
|
|||
except BrokenPageError:
|
||||
pass
|
||||
|
||||
|
||||
class LoginPage(_LogoutPage):
|
||||
def login(self, login):
|
||||
self.browser.select_form(name='Main')
|
||||
|
|
@ -83,6 +84,7 @@ class LoginPage(_LogoutPage):
|
|||
class ErrorPage(_LogoutPage):
|
||||
pass
|
||||
|
||||
|
||||
class UnavailablePage(Page):
|
||||
def on_loaded(self):
|
||||
try:
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue