Pep8 on ecrans module

This commit is contained in:
Florent 2012-03-13 17:31:24 +01:00
commit b0e8c10499
4 changed files with 18 additions and 14 deletions

View file

@ -23,6 +23,7 @@ from weboob.tools.capabilities.messages.GenericBackend import GenericNewspaperBa
from .browser import NewspaperEcransBrowser
from .tools import rssid, url2id
class NewspaperEcransBackend(GenericNewspaperBackend, ICapMessages):
MAINTAINER = 'Julien Hebert'
EMAIL = 'juke@free.fr'
@ -37,4 +38,3 @@ class NewspaperEcransBackend(GenericNewspaperBackend, ICapMessages):
URL2ID = staticmethod(url2id)
# RSS Size is actually 10, but some articles are not sorted by publication date
RSSSIZE = 40

View file

@ -22,7 +22,6 @@ from .pages.article import ArticlePage
from weboob.tools.browser import BaseBrowser
class NewspaperEcransBrowser(BaseBrowser):
"NewspaperEcransBrowser class"
PAGES = {

View file

@ -19,6 +19,8 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.capabilities.messages.genericArticle import GenericNewsPage, remove_from_selector_list, try_remove_from_selector_list, try_drop_tree
class ArticlePage(GenericNewsPage):
"ArticlePage object for inrocks"
def on_loaded(self):
@ -34,4 +36,3 @@ class ArticlePage(GenericNewsPage):
try_drop_tree(self.parser, element_body, "script")
return self.parser.tostring(element_body)

View file

@ -20,6 +20,8 @@
import re
def id2url(_id):
"return an url from an id"
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
@ -31,6 +33,7 @@ def id2url(_id):
else:
raise ValueError("id doesn't match")
def url2id(url):
"return an id from an url"
regexp = re.compile("(^.*),([0-9]+)\.html$")
@ -40,5 +43,6 @@ def url2id(url):
else:
raise ValueError("Can't find an id for the url")
def rssid(entry):
return url2id(entry.id)