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:
Laurent Bachelier 2013-03-15 20:01:49 +01:00
commit 7094931c92
231 changed files with 474 additions and 67 deletions

View file

@ -40,6 +40,7 @@ class Link(object):
self.title = u''
self.date = None
class ForumPage(PhpBBPage):
def iter_links(self):
for li in self.parser.select(self.document.getroot(), 'ul.forums li.row'):
@ -72,6 +73,7 @@ class ForumPage(PhpBBPage):
yield value, option.text.strip(u'» \xa0\n\r')
class Post(object):
def __init__(self, forum_id, topic_id, id):
self.id = int(id)
@ -84,6 +86,7 @@ class Post(object):
self.signature = u''
self.parent = 0
class TopicPage(PhpBBPage):
def on_loaded(self):
div = self.document.getroot().cssselect('div.pagination')[0]

View file

@ -20,6 +20,7 @@
from weboob.tools.browser import BasePage
class PhpBBPage(BasePage):
def is_logged(self):
return len(self.document.getroot().cssselect('li.icon-register')) == 0
@ -35,5 +36,6 @@ class PhpBBPage(BasePage):
errors.append(div.text.strip())
return ', '.join(errors)
class LoginPage(PhpBBPage):
pass

View file

@ -42,6 +42,7 @@ def url2id(url, nopost=False):
return None
def id2url(id):
v = id.split('.')
if len(v) == 1:
@ -54,15 +55,18 @@ def id2url(id):
int(v[2]),
int(v[2]))
def id2topic(id):
try:
return int(id.split('.')[1])
except IndexError:
return None
def rssid(id):
return id
def parse_date(s):
s = s.replace(u'Fév', 'Feb') \
.replace(u'Avr', 'Apr') \