pep8 on presseurop module
This commit is contained in:
parent
b0e8c10499
commit
a379396869
4 changed files with 11 additions and 8 deletions
|
|
@ -40,7 +40,7 @@ class NewspaperPresseuropBackend(GenericNewspaperBackend, ICapMessages):
|
|||
URL2ID = staticmethod(url2id)
|
||||
RSSSIZE = 50
|
||||
CONFIG = BackendConfig(Value('lang', label='Lang of articles',
|
||||
choices={'fr': 'fr', 'de': 'de', 'en': 'en', 'cs': 'cs', 'es' : 'es', 'it' : 'it', 'nl' : 'nl', 'pl' : 'pl', 'pt' : 'pt', 'ro' : 'ro'}, default='fr'))
|
||||
choices={'fr': 'fr', 'de': 'de', 'en': 'en', 'cs': 'cs', 'es': 'es', 'it': 'it', 'nl': 'nl', 'pl': 'pl', 'pt': 'pt', 'ro': 'ro'}, default='fr'))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
GenericNewspaperBackend.__init__(self, *args, **kwargs)
|
||||
|
|
@ -49,7 +49,6 @@ class NewspaperPresseuropBackend(GenericNewspaperBackend, ICapMessages):
|
|||
def iter_threads(self):
|
||||
for article in Newsfeed(self.RSS_FEED, self.RSSID).iter_entries():
|
||||
thread = Thread(article.link)
|
||||
thread.title = article.title
|
||||
thread.title = article.title
|
||||
thread.date = article.datetime
|
||||
yield(thread)
|
||||
|
||||
|
|
|
|||
|
|
@ -41,4 +41,3 @@ class NewspaperPresseuropBrowser(BaseBrowser):
|
|||
"return page article content"
|
||||
self.location(_id)
|
||||
return self.page.get_article(_id)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,14 +19,16 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from weboob.tools.capabilities.messages.genericArticle import GenericNewsPage
|
||||
|
||||
|
||||
class ArticlePage(GenericNewsPage):
|
||||
"ArticlePage object for presseurop"
|
||||
|
||||
|
||||
def on_loaded(self):
|
||||
self.main_div = self.document.getroot()
|
||||
self.element_title_selector = "title"
|
||||
self.element_author_selector = "div.content-author>a"
|
||||
self.element_body_selector = "div.block"
|
||||
self.element_author_selector = "div.content-author>a"
|
||||
self.element_body_selector = "div.block"
|
||||
|
||||
def get_body(self):
|
||||
element_body = self.get_element_body()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"tools for presseurop backend"
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright(C) 2012 Florent Fourcot
|
||||
# Copyright(C) 2012 Florent Fourcot
|
||||
# This file is part of weboob.
|
||||
#
|
||||
# weboob is free software: you can redistribute it and/or modify
|
||||
|
|
@ -19,11 +19,14 @@
|
|||
|
||||
|
||||
import re
|
||||
|
||||
|
||||
def url2id(url):
|
||||
"return an id from an url"
|
||||
regexp = re.compile(".*/([0-9]+)-.*")
|
||||
id = regexp.match(url).group(1)
|
||||
return id
|
||||
|
||||
|
||||
def rssid(entry):
|
||||
return url2id(entry.link)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue