Easy spacing fixes, trailing stuff
Remove useless trailing \ Remove trailing spaces Add missing empty lines autopep8 -ir -j2 --select=E301,E302,E502,W291,W293,W391 . Diff quickly checked.
This commit is contained in:
parent
c21d1f7925
commit
7094931c92
231 changed files with 474 additions and 67 deletions
|
|
@ -55,7 +55,7 @@ class AloesBrowser(BaseBrowser):
|
|||
assert isinstance(self.username, basestring)
|
||||
assert isinstance(self.password, basestring)
|
||||
if not self.is_on_page(HomePage):
|
||||
self.location('%s://%s/index.aspx' \
|
||||
self.location('%s://%s/index.aspx'
|
||||
% (self.PROTOCOL, self.BASEURL),
|
||||
no_login=True)
|
||||
if not self.page.login(self.username, self.password) or \
|
||||
|
|
@ -65,13 +65,13 @@ class AloesBrowser(BaseBrowser):
|
|||
|
||||
def get_rented_books_list(self):
|
||||
if not self.is_on_page(RentedPage):
|
||||
self.location('%s://%s/index.aspx?IdPage=45' \
|
||||
self.location('%s://%s/index.aspx?IdPage=45'
|
||||
% (self.PROTOCOL, self.BASEURL)
|
||||
)
|
||||
return self.page.get_list()
|
||||
|
||||
def get_booked_books_list(self):
|
||||
if not self.is_on_page(BookedPage):
|
||||
self.location('%s://%s/index.aspx?IdPage=44' \
|
||||
self.location('%s://%s/index.aspx?IdPage=44'
|
||||
% (self.PROTOCOL, self.BASEURL))
|
||||
return self.page.get_list()
|
||||
|
|
|
|||
|
|
@ -22,12 +22,15 @@ from weboob.capabilities.library import Book
|
|||
from weboob.tools.browser import BasePage, BrowserUnavailable
|
||||
from weboob.tools.mech import ClientForm
|
||||
|
||||
|
||||
class SkipPage(BasePage):
|
||||
pass
|
||||
|
||||
|
||||
class HomePage(BasePage):
|
||||
pass
|
||||
|
||||
|
||||
def txt2date(s):
|
||||
return date(*reversed([int(x) for x in s.split(' ')[-1].split('/')]))
|
||||
|
||||
|
|
@ -51,6 +54,7 @@ class RentedPage(BasePage):
|
|||
book.date = txt2date(tr[start+5].text)
|
||||
yield book
|
||||
|
||||
|
||||
class HistoryPage(BasePage):
|
||||
pass
|
||||
|
||||
|
|
@ -75,6 +79,7 @@ class BookedPage(BasePage):
|
|||
book.late = False
|
||||
yield book
|
||||
|
||||
|
||||
class LoginPage(BasePage):
|
||||
def login(self, login, passwd):
|
||||
self.browser.select_form(predicate=lambda x: x.attrs.get('id','')=='aspnetForm')
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
from weboob.tools.test import BackendTest
|
||||
|
||||
|
||||
class AloestTest(BackendTest):
|
||||
BACKEND = 'aloes'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue