Some manual style fixes

This commit is contained in:
Laurent Bachelier 2013-03-15 22:31:33 +01:00
commit fbe0fb8d52
10 changed files with 18 additions and 14 deletions

View file

@ -27,7 +27,8 @@ except ImportError:
raise ImportError('Please install python-imaging')
class CaptchaError(Exception): pass
class CaptchaError(Exception):
pass
class Tile(object):

View file

@ -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)

View file

@ -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)

View file

@ -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):

View file

@ -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:

View file

@ -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()