From c2c248794ec4d3b5a3c1ef7c0bf6abfcdcbd2048 Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 29 Oct 2013 16:15:12 +0100 Subject: [PATCH] Remove Ecrans.fr module --- modules/ecrans/__init__.py | 24 ----------------- modules/ecrans/backend.py | 40 ---------------------------- modules/ecrans/browser.py | 44 ------------------------------- modules/ecrans/favicon.png | Bin 1729 -> 0 bytes modules/ecrans/pages/__init__.py | 0 modules/ecrans/pages/article.py | 39 --------------------------- modules/ecrans/test.py | 32 ---------------------- modules/ecrans/tools.py | 35 ------------------------ 8 files changed, 214 deletions(-) delete mode 100644 modules/ecrans/__init__.py delete mode 100644 modules/ecrans/backend.py delete mode 100644 modules/ecrans/browser.py delete mode 100644 modules/ecrans/favicon.png delete mode 100644 modules/ecrans/pages/__init__.py delete mode 100644 modules/ecrans/pages/article.py delete mode 100644 modules/ecrans/test.py delete mode 100644 modules/ecrans/tools.py diff --git a/modules/ecrans/__init__.py b/modules/ecrans/__init__.py deleted file mode 100644 index 8f7d0d4d..00000000 --- a/modules/ecrans/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -"NewspaperEcransBackend init" -# -*- coding: utf-8 -*- - -# Copyright(C) 2011 Julien Hebert -# -# This file is part of weboob. -# -# weboob is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# weboob is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with weboob. If not, see . - -from .backend import NewspaperEcransBackend - - -__all__ = ['NewspaperEcransBackend'] diff --git a/modules/ecrans/backend.py b/modules/ecrans/backend.py deleted file mode 100644 index 3d7f523b..00000000 --- a/modules/ecrans/backend.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright(C) 2011 Julien Hebert -# -# This file is part of weboob. -# -# weboob is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# weboob is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with weboob. If not, see . -"backend for http://www.ecrans.fr" - -from weboob.capabilities.messages import ICapMessages -from weboob.tools.capabilities.messages.GenericBackend import GenericNewspaperBackend -from .browser import NewspaperEcransBrowser -from .tools import rssid, url2id - - -class NewspaperEcransBackend(GenericNewspaperBackend, ICapMessages): - MAINTAINER = u'Julien Hebert' - EMAIL = 'juke@free.fr' - VERSION = '0.h' - LICENSE = 'AGPLv3+' - STORAGE = {'seen': {}} - NAME = 'ecrans' - DESCRIPTION = u'Écrans French news website' - BROWSER = NewspaperEcransBrowser - RSS_FEED = 'http://www.ecrans.fr/rss/53/spip.php?page=backend' - RSSID = staticmethod(rssid) - URL2ID = staticmethod(url2id) - # RSS Size is actually 10, but some articles are not sorted by publication date - RSSSIZE = 40 diff --git a/modules/ecrans/browser.py b/modules/ecrans/browser.py deleted file mode 100644 index 0598a117..00000000 --- a/modules/ecrans/browser.py +++ /dev/null @@ -1,44 +0,0 @@ -"browser for ecrans website" -# -*- coding: utf-8 -*- - -# Copyright(C) 2011 Julien Hebert -# -# This file is part of weboob. -# -# weboob is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# weboob is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with weboob. If not, see . - -from .pages.article import ArticlePage -from weboob.tools.browser import BaseBrowser - - -class NewspaperEcransBrowser(BaseBrowser): - "NewspaperEcransBrowser class" - PAGES = { - "http://www.ecrans.fr/.*": ArticlePage, - } - - def is_logged(self): - return False - - def login(self): - pass - - def fillobj(self, obj, fields): - pass - - def get_content(self, _id): - "return page article content" - url = _id.replace('/rss/53', '') - self.location(url) - return self.page.get_article(url) diff --git a/modules/ecrans/favicon.png b/modules/ecrans/favicon.png deleted file mode 100644 index 59f386420a1e6b7bf4ceb8eaec7d9b6d88d31b82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1729 zcmV;y20rPx#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipT3 z3@{HD9bwo2000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000IYNklUFM=pi(I8Y1t=bSxglHYguX!$;9>u$2ytu#M)r;yn@@H~%d&S#Awzfg5E6+52XlTIs^XCx`hfz(ue*L$t0?cQmIr;63SEl(xppST3UjV z7#ti_p8$qo(ACw2NF)L^V6)lOC1BsaeR%ci71YA;@UVIWFbso>7cVNZ@7IHz0h6R$ zz+^JfxpU`8r_+@kcK-PBgW~ZxEiNur6k02u3^5Etot>SubLY;oKJ@wXXF7ZKEHySZ zQfq4~ojP@j#>U3T@ApfV<#0HZ&jrk8GXjBtWOM!g{X1MP*P3Rl(P(h`^l7A0DbX^= z$H!&c0;01)v)N4Bw{I8CYN=GByLazWe}6xPLZP+U2S^YEs;d*f8##_s-U5b(h9s^0 z?CdP|?Ah~2xrYuN!rQlRCCQ$cm{8scvMei_(Nro$SFT)Hcja|D9d&niliTg4wzf7& zE0#zkl(&GXsVUJb^!4jk7>&j?W$oR&7uT;}M>?G@%cnRT4&{Bo($bP>MuWj1MWfMG zkFTRgk5YesKXDvK_4V~-9iww|bIO;*8X6iz3*EYP>;Fn&XU?3V#>PfEeE2YFwc4^2 zCnEaw>leA*ZduD`q6v@^xGXL%63_G0*VjiaEiGiRSY(;(n>TOh@#Dvo&*zo*0bZ|H z^gf-Qp2oz)gskE3?CdO#9617pVbsY5?%lg5da|KVNLJ;;;V`2KRZ_|qxFRG@zBqwOGSn%!Jx2os*;cyrO0|VeVt}1)JY$s?i7;xv#ovJAwi^bse zdePqA4xLW7@ot6~hCxqH53<>;?25mC|Nif|8r!jB2Yf!CXyuBC>mQfB$~kvgOZzt*fh}QmI6@Zr!4EI!$`Lo_szZEi5dM&*!6LGASv? z*bukF?d|Q7O5%k=0i&a%U|CkRRbFq@6H&huw$kY|nayT8c<>-;G#XJ>V6j*zpU=~~ zckd{h&2G3R3CXNktyW1jyk*?Hc@rGRL8H<9y%s=3^!xX3I(FEt zFh4(!$;ru8k3yDZVYOP}@pur6#ZW4h)@`P!fQ0h*kKJy^$B!Q?4u%qm1Qr$+;Pra( z?AbGTyp_!Vk4ln zwN;%aDVAk1Ffg!r3HYxiRHIRc(IAAqovss#%nW0=RN6pR6q}S^ejpoM2#_0L; z=ak80)a?{ySr#Wxp2Vk5pDH>crC@4mN}XeHz0uUvgv*yNBa_LjdxlqnOeTZr>1o*Q zcI5*hDW$Z*!9nD5IoT|tSS%tMjbdbE1Z{0?m6pzwNjfYR3wnEd5s$~qZlx_03W!Fd zaJ${GTCH-W*ve*KJkP`Fbi(iVV}5>Kl;WvW3UhOF7#|;(Q}KU0R7j. - -from weboob.tools.capabilities.messages.genericArticle import GenericNewsPage, remove_from_selector_list, try_remove_from_selector_list, try_drop_tree, clean_relativ_urls - - -class ArticlePage(GenericNewsPage): - "ArticlePage object for ecrans" - def on_loaded(self): - self.main_div = self.document.getroot() - self.element_title_selector = "title" - self.element_author_selector = "p.auteur>a" - self.element_body_selector = "div.bloc_article_01" - - def get_body(self): - element_body = self.get_element_body() - remove_from_selector_list(self.parser, element_body, ["p.auteur", "h4"]) - try_remove_from_selector_list(self.parser, element_body, ["p.tag", "div.alire", self.element_title_selector, "h4"]) - try_drop_tree(self.parser, element_body, "script") - clean_relativ_urls(element_body, "http://ecrans.fr") - - return self.parser.tostring(element_body) diff --git a/modules/ecrans/test.py b/modules/ecrans/test.py deleted file mode 100644 index 32183395..00000000 --- a/modules/ecrans/test.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright(C) 2010-2011 Romain Bignon -# -# This file is part of weboob. -# -# weboob is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# weboob is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with weboob. If not, see . - - -from weboob.tools.test import BackendTest - - -__all__ = ['EcransTest'] - - -class EcransTest(BackendTest): - BACKEND = 'ecrans' - - def test_new_messages(self): - for message in self.backend.iter_unread_messages(): - pass diff --git a/modules/ecrans/tools.py b/modules/ecrans/tools.py deleted file mode 100644 index 6163e3a9..00000000 --- a/modules/ecrans/tools.py +++ /dev/null @@ -1,35 +0,0 @@ -"tools for lefigaro backend" -# -*- coding: utf-8 -*- - -# Copyright(C) 2011 Julien Hebert -# -# This file is part of weboob. -# -# weboob is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# weboob is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with weboob. If not, see . - -import re - - -def url2id(url): - "return an id from an url" - regexp = re.compile("(^.*),([0-9]+)\.html$") - match = regexp.match(url) - if match: - return match.group(2) - else: - raise ValueError("Can't find an id for the url") - - -def rssid(entry): - return url2id(entry.id)