PEP 8 fix
This commit is contained in:
parent
5a7ae0a5bd
commit
3bc2312338
15 changed files with 48 additions and 7 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
"init of NewspaperInrocksBackend"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
@ -16,4 +17,4 @@
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
from .backend import NewspaperInrocksBackend
|
from .backend import NewspaperInrocksBackend
|
||||||
__all__ = ['NewspaperInrocksBackendBackend']
|
__all__ = ['NewspaperInrocksBackend']
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ from .tools import url2id
|
||||||
from .browser import NewspaperInrocksBrowser
|
from .browser import NewspaperInrocksBrowser
|
||||||
|
|
||||||
class NewspaperInrocksBackend(BaseBackend, ICapMessages):
|
class NewspaperInrocksBackend(BaseBackend, ICapMessages):
|
||||||
|
"NewspaperInrocksBackend class"
|
||||||
MAINTAINER = 'Julien Hebert'
|
MAINTAINER = 'Julien Hebert'
|
||||||
EMAIL = 'juke@free.fr'
|
EMAIL = 'juke@free.fr'
|
||||||
VERSION = '0.6'
|
VERSION = '0.6'
|
||||||
|
|
@ -78,6 +79,7 @@ class NewspaperInrocksBackend(BaseBackend, ICapMessages):
|
||||||
yield(thread)
|
yield(thread)
|
||||||
|
|
||||||
def fill_thread(self, thread):
|
def fill_thread(self, thread):
|
||||||
|
"fill the thread"
|
||||||
return self.get_thread(thread)
|
return self.get_thread(thread)
|
||||||
|
|
||||||
def iter_unread_messages(self, thread=None):
|
def iter_unread_messages(self, thread=None):
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"browser for inrocks.fr website"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
@ -21,15 +22,21 @@ from weboob.tools.browser import BaseBrowser
|
||||||
|
|
||||||
|
|
||||||
class NewspaperInrocksBrowser(BaseBrowser):
|
class NewspaperInrocksBrowser(BaseBrowser):
|
||||||
|
"NewspaperInrocksBrowser class"
|
||||||
PAGES = {
|
PAGES = {
|
||||||
'.*': ArticlePage,
|
'.*': ArticlePage,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def login(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def fillobj(self, obj, fields):
|
||||||
|
pass
|
||||||
|
|
||||||
def get_content(self, _id):
|
def get_content(self, _id):
|
||||||
url = _id
|
"return page article content"
|
||||||
self.location(url)
|
self.location(_id)
|
||||||
return self.page.get_article(_id)
|
return self.page.get_article(_id)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"common tools for inrocks backend"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
@ -18,6 +19,7 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
def id2url(_id):
|
def id2url(_id):
|
||||||
|
"return an url from an id"
|
||||||
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
|
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
|
||||||
match = regexp2.match(_id)
|
match = regexp2.match(_id)
|
||||||
if match:
|
if match:
|
||||||
|
|
@ -28,4 +30,5 @@ def id2url(_id):
|
||||||
raise ValueError("id doesn't match")
|
raise ValueError("id doesn't match")
|
||||||
|
|
||||||
def url2id(url):
|
def url2id(url):
|
||||||
|
"return an id from an url"
|
||||||
return url
|
return url
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"NewspaperFigaroBackend init"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ from .tools import url2id
|
||||||
from .browser import NewspaperFigaroBrowser
|
from .browser import NewspaperFigaroBrowser
|
||||||
|
|
||||||
class NewspaperFigaroBackend(BaseBackend, ICapMessages):
|
class NewspaperFigaroBackend(BaseBackend, ICapMessages):
|
||||||
|
"NewspaperFigaroBackend class"
|
||||||
MAINTAINER = 'Julien Hebert'
|
MAINTAINER = 'Julien Hebert'
|
||||||
EMAIL = 'juke@free.fr'
|
EMAIL = 'juke@free.fr'
|
||||||
VERSION = '0.6'
|
VERSION = '0.6'
|
||||||
|
|
@ -78,6 +79,7 @@ class NewspaperFigaroBackend(BaseBackend, ICapMessages):
|
||||||
yield(thread)
|
yield(thread)
|
||||||
|
|
||||||
def fill_thread(self, thread):
|
def fill_thread(self, thread):
|
||||||
|
"fill the thread"
|
||||||
return self.get_thread(thread)
|
return self.get_thread(thread)
|
||||||
|
|
||||||
def iter_unread_messages(self, thread=None):
|
def iter_unread_messages(self, thread=None):
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"browser for lefigaro website"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
@ -22,6 +23,7 @@ from weboob.tools.browser import BaseBrowser
|
||||||
|
|
||||||
|
|
||||||
class NewspaperFigaroBrowser(BaseBrowser):
|
class NewspaperFigaroBrowser(BaseBrowser):
|
||||||
|
"NewspaperFigaroBrowser class"
|
||||||
PAGES = {
|
PAGES = {
|
||||||
"http://www.lefigaro.fr/flash-actu/([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9])/(.*$)": FlashActuPage,
|
"http://www.lefigaro.fr/flash-actu/([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9])/(.*$)": FlashActuPage,
|
||||||
"http://www.lefigaro.fr/flash-sport/([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9])/(.*$)": FlashActuPage,
|
"http://www.lefigaro.fr/flash-sport/([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9])/(.*$)": FlashActuPage,
|
||||||
|
|
@ -42,8 +44,13 @@ class NewspaperFigaroBrowser(BaseBrowser):
|
||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def login(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def fillobj(self, obj, fields):
|
||||||
|
pass
|
||||||
|
|
||||||
def get_content(self, _id):
|
def get_content(self, _id):
|
||||||
url = _id
|
"return page article content"
|
||||||
self.location(url)
|
self.location(_id)
|
||||||
print self.page
|
|
||||||
return self.page.get_article(_id)
|
return self.page.get_article(_id)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"tools for lefigaro backend"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
@ -18,6 +19,7 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
def id2url(_id):
|
def id2url(_id):
|
||||||
|
"return an url from an id"
|
||||||
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
|
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
|
||||||
match = regexp2.match(_id)
|
match = regexp2.match(_id)
|
||||||
if match:
|
if match:
|
||||||
|
|
@ -28,4 +30,5 @@ def id2url(_id):
|
||||||
raise ValueError("id doesn't match")
|
raise ValueError("id doesn't match")
|
||||||
|
|
||||||
def url2id(url):
|
def url2id(url):
|
||||||
|
"return an id from an url"
|
||||||
return url
|
return url
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"init of Newspaper20minutesBackend"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ from .tools import url2id
|
||||||
from .browser import Newspaper20minutesBrowser
|
from .browser import Newspaper20minutesBrowser
|
||||||
|
|
||||||
class Newspaper20minutesBackend(BaseBackend, ICapMessages):
|
class Newspaper20minutesBackend(BaseBackend, ICapMessages):
|
||||||
|
"Newspaper20minutesBackend class"
|
||||||
MAINTAINER = 'Julien Hebert'
|
MAINTAINER = 'Julien Hebert'
|
||||||
EMAIL = 'juke@free.fr'
|
EMAIL = 'juke@free.fr'
|
||||||
VERSION = '0.6'
|
VERSION = '0.6'
|
||||||
|
|
@ -78,6 +79,7 @@ class Newspaper20minutesBackend(BaseBackend, ICapMessages):
|
||||||
yield(thread)
|
yield(thread)
|
||||||
|
|
||||||
def fill_thread(self, thread):
|
def fill_thread(self, thread):
|
||||||
|
"fill the thread"
|
||||||
return self.get_thread(thread)
|
return self.get_thread(thread)
|
||||||
|
|
||||||
def iter_unread_messages(self, thread=None):
|
def iter_unread_messages(self, thread=None):
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"browser for 20minutes website"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
@ -22,6 +23,7 @@ from .tools import id2url
|
||||||
|
|
||||||
|
|
||||||
class Newspaper20minutesBrowser(BaseBrowser):
|
class Newspaper20minutesBrowser(BaseBrowser):
|
||||||
|
"Newspaper20minutesBrowser class"
|
||||||
PAGES = {
|
PAGES = {
|
||||||
'http://www.20minutes.fr/article/?.*': ArticlePage,
|
'http://www.20minutes.fr/article/?.*': ArticlePage,
|
||||||
'http://www.20minutes.fr/ledirect/?.*': SimplePage,
|
'http://www.20minutes.fr/ledirect/?.*': SimplePage,
|
||||||
|
|
@ -31,7 +33,14 @@ class Newspaper20minutesBrowser(BaseBrowser):
|
||||||
def is_logged(self):
|
def is_logged(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def login(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def fillobj(self, obj, fields):
|
||||||
|
pass
|
||||||
|
|
||||||
def get_content(self, _id):
|
def get_content(self, _id):
|
||||||
|
"return page article content"
|
||||||
try :
|
try :
|
||||||
url = id2url(_id)
|
url = id2url(_id)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"common tools for 20minutes backend"
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright(C) 2011 Julien Hebert
|
# Copyright(C) 2011 Julien Hebert
|
||||||
|
|
@ -18,6 +19,7 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
def id2url(_id):
|
def id2url(_id):
|
||||||
|
"return an url from an id"
|
||||||
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
|
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
|
||||||
match = regexp2.match(_id)
|
match = regexp2.match(_id)
|
||||||
if match:
|
if match:
|
||||||
|
|
@ -28,6 +30,7 @@ def id2url(_id):
|
||||||
raise ValueError("id doesn't match")
|
raise ValueError("id doesn't match")
|
||||||
|
|
||||||
def url2id(url):
|
def url2id(url):
|
||||||
|
"return an id from an url"
|
||||||
regexp = re.compile("http://www.20minutes.fr/(\w+)/([0-9]+)/(.*$)")
|
regexp = re.compile("http://www.20minutes.fr/(\w+)/([0-9]+)/(.*$)")
|
||||||
match = regexp.match(url)
|
match = regexp.match(url)
|
||||||
return '%s.%d.%s' % (match.group(1), int(match.group(2)), match.group(3))
|
return '%s.%d.%s' % (match.group(1), int(match.group(2)), match.group(3))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue