Pep8 cleaning

This commit is contained in:
Florent 2013-01-24 21:30:14 +01:00
commit 4a327e153e
2 changed files with 9 additions and 6 deletions

View file

@ -40,11 +40,14 @@ class NewspaperPresseuropBackend(GenericNewspaperBackend, ICapMessages):
URL2ID = staticmethod(url2id)
RSSSIZE = 180
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)
self.RSS_FEED = 'http://www.presseurop.eu/%s/rss.xml' % (self.config['lang'].get())
self.RSS_FEED = 'http://www.presseurop.eu/%s/rss.xml' % self.config['lang'].get()
def iter_threads(self):
daily = []

View file

@ -18,8 +18,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.capabilities.messages.genericArticle import GenericNewsPage, try_drop_tree, \
clean_relativ_urls
from weboob.tools.capabilities.messages.genericArticle import GenericNewsPage,\
try_drop_tree, clean_relativ_urls
class PresseuropPage(GenericNewsPage):
@ -61,10 +61,10 @@ class DailyTitlesPage(PresseuropPage):
return self.parser.tostring(element_body)
class DailySinglePage(PresseuropPage):
def get_daily_date(self):
ul = self.document.getroot().xpath("//ul[@class='carousel-skin carousel-today']")
ul = self.document.getroot().xpath(
"//ul[@class='carousel-skin carousel-today']")
if len(ul) > 0:
link = ul[0].xpath('li/a')[0]
date = link.attrib['href'].split('/')[3]