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
|
|
@ -23,8 +23,10 @@ from logging import warning
|
|||
|
||||
from weboob.tools.browser import BasePage
|
||||
|
||||
|
||||
class Message(object):
|
||||
TIMESTAMP_REGEXP = re.compile(r'(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})')
|
||||
|
||||
def __init__(self, id, timestamp, login, message, is_me):
|
||||
self.id = id
|
||||
self.timestamp = timestamp
|
||||
|
|
@ -40,6 +42,7 @@ class Message(object):
|
|||
else:
|
||||
warning('Unable to parse timestamp "%s"' % timestamp)
|
||||
|
||||
|
||||
class BoardIndexPage(BasePage):
|
||||
def is_logged(self):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
from weboob.tools.browser import BasePage
|
||||
|
||||
|
||||
class DLFPPage(BasePage):
|
||||
def is_logged(self):
|
||||
for form in self.document.getiterator('form'):
|
||||
|
|
@ -28,6 +29,7 @@ class DLFPPage(BasePage):
|
|||
|
||||
return True
|
||||
|
||||
|
||||
class IndexPage(DLFPPage):
|
||||
def get_login_token(self):
|
||||
form = self.parser.select(self.document.getroot(), 'form#new_account_sidebar', 1)
|
||||
|
|
@ -35,5 +37,6 @@ class IndexPage(DLFPPage):
|
|||
if i.attrib['name'] == 'authenticity_token':
|
||||
return i.attrib['value']
|
||||
|
||||
|
||||
class LoginPage(DLFPPage):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -26,10 +26,12 @@ from ..tools import url2id
|
|||
|
||||
from .index import DLFPPage
|
||||
|
||||
|
||||
class RSSComment(DLFPPage):
|
||||
def on_loaded(self):
|
||||
pass
|
||||
|
||||
|
||||
class Content(object):
|
||||
TAGGABLE = False
|
||||
|
||||
|
|
@ -50,6 +52,7 @@ class Content(object):
|
|||
def is_taggable(self):
|
||||
return False
|
||||
|
||||
|
||||
class Comment(Content):
|
||||
def __init__(self, article, div, reply_id):
|
||||
Content.__init__(self, article.browser)
|
||||
|
|
@ -105,6 +108,7 @@ class Comment(Content):
|
|||
def __repr__(self):
|
||||
return u"<Comment id=%r author=%r title=%r>" % (self.id, self.author, self.title)
|
||||
|
||||
|
||||
class Article(Content):
|
||||
TAGGABLE = True
|
||||
|
||||
|
|
@ -149,11 +153,13 @@ class Article(Content):
|
|||
for c in comment.iter_all_comments():
|
||||
yield c
|
||||
|
||||
|
||||
class CommentPage(DLFPPage):
|
||||
def get_comment(self):
|
||||
article = Article(self.browser, self.url, None)
|
||||
return Comment(article, self.parser.select(self.document.getroot(), 'li.comment', 1), 0)
|
||||
|
||||
|
||||
class ContentPage(DLFPPage):
|
||||
def on_loaded(self):
|
||||
self.article = None
|
||||
|
|
@ -192,9 +198,11 @@ class ContentPage(DLFPPage):
|
|||
def get_tag_url(self):
|
||||
return self.parser.select(self.document.getroot(), 'div.tag_in_place', 1).find('a').attrib['href']
|
||||
|
||||
|
||||
class NewCommentPage(DLFPPage):
|
||||
pass
|
||||
|
||||
|
||||
class NewTagPage(DLFPPage):
|
||||
def _is_tag_form(self, form):
|
||||
return form.action.endswith('/tags')
|
||||
|
|
@ -204,6 +212,7 @@ class NewTagPage(DLFPPage):
|
|||
self.browser['tags'] = tag
|
||||
self.browser.submit()
|
||||
|
||||
|
||||
class NodePage(DLFPPage):
|
||||
def get_errors(self):
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ from weboob.tools.browser import BrokenPageError
|
|||
|
||||
from .index import DLFPPage
|
||||
|
||||
|
||||
class WikiEditPage(DLFPPage):
|
||||
def get_body(self):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue