s/Backend/Module
This commit is contained in:
parent
5fe0092c2c
commit
9370b2fae7
344 changed files with 720 additions and 720 deletions
|
|
@ -25,7 +25,7 @@ from weboob.capabilities.gallery import CapGallery, BaseGallery, BaseImage
|
|||
from weboob.tools.backend import BaseModule
|
||||
from weboob.tools.browser import BaseBrowser, BasePage
|
||||
|
||||
__all__ = ['GenericComicReaderBackend']
|
||||
__all__ = ['GenericComicReaderModule']
|
||||
|
||||
|
||||
class DisplayPage(BasePage):
|
||||
|
|
@ -63,7 +63,7 @@ class GenericComicReaderBrowser(BaseBrowser):
|
|||
image.data = self.readurl(image.url)
|
||||
|
||||
|
||||
class GenericComicReaderBackend(BaseModule, CapGallery):
|
||||
class GenericComicReaderModule(BaseModule, CapGallery):
|
||||
NAME = 'genericcomicreader'
|
||||
MAINTAINER = u'Noé Rubinstein'
|
||||
EMAIL = 'noe.rubinstein@gmail.com'
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ from weboob.tools.backend import BaseModule
|
|||
from weboob.tools.newsfeed import Newsfeed
|
||||
|
||||
|
||||
class GenericNewspaperBackend(BaseModule, CapMessages):
|
||||
class GenericNewspaperModule(BaseModule, CapMessages):
|
||||
"""
|
||||
GenericNewspaperBackend class
|
||||
GenericNewspaperModule class
|
||||
"""
|
||||
MAINTAINER = u'Julien Hebert'
|
||||
EMAIL = 'juke@free.fr'
|
||||
|
|
@ -78,7 +78,7 @@ class GenericNewspaperBackend(BaseModule, CapMessages):
|
|||
return thread
|
||||
|
||||
def iter_threads(self):
|
||||
for article in Newsfeed(self.RSS_FEED, GenericNewspaperBackend.RSSID).iter_entries():
|
||||
for article in Newsfeed(self.RSS_FEED, GenericNewspaperModule.RSSID).iter_entries():
|
||||
thread = Thread(article.id)
|
||||
thread.title = article.title
|
||||
thread.date = article.datetime
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from weboob.capabilities.paste import CapPaste
|
|||
import binascii
|
||||
|
||||
|
||||
class BasePasteBackend(CapPaste):
|
||||
class BasePasteModule(CapPaste):
|
||||
EXPIRATIONS = {}
|
||||
"""
|
||||
List of expirations and their corresponding remote codes (any type can be used).
|
||||
|
|
@ -71,18 +71,18 @@ def image_mime(data_base64, supported_formats=('gif', 'jpeg', 'png')):
|
|||
return 'image/tiff'
|
||||
|
||||
def test():
|
||||
class MockPasteBackend(BasePasteBackend):
|
||||
class MockPasteModule(BasePasteModule):
|
||||
def __init__(self, expirations):
|
||||
self.EXPIRATIONS = expirations
|
||||
|
||||
# all expirations are too high
|
||||
assert MockPasteBackend({1337: '', 42: '', False: ''}).get_closest_expiration(1) is None
|
||||
assert MockPasteModule({1337: '', 42: '', False: ''}).get_closest_expiration(1) is None
|
||||
# we found a suitable lower or equal expiration
|
||||
assert MockPasteBackend({1337: '', 42: '', False: ''}).get_closest_expiration(84) is 42
|
||||
assert MockPasteBackend({1337: '', 42: '', False: ''}).get_closest_expiration(False) is False
|
||||
assert MockPasteBackend({1337: '', 42: ''}).get_closest_expiration(False) is 1337
|
||||
assert MockPasteBackend({1337: '', 42: '', False: ''}).get_closest_expiration(1336) is 42
|
||||
assert MockPasteBackend({1337: '', 42: '', False: ''}).get_closest_expiration(1337) is 1337
|
||||
assert MockPasteBackend({1337: '', 42: '', False: ''}).get_closest_expiration(1338) is 1337
|
||||
assert MockPasteModule({1337: '', 42: '', False: ''}).get_closest_expiration(84) is 42
|
||||
assert MockPasteModule({1337: '', 42: '', False: ''}).get_closest_expiration(False) is False
|
||||
assert MockPasteModule({1337: '', 42: ''}).get_closest_expiration(False) is 1337
|
||||
assert MockPasteModule({1337: '', 42: '', False: ''}).get_closest_expiration(1336) is 42
|
||||
assert MockPasteModule({1337: '', 42: '', False: ''}).get_closest_expiration(1337) is 1337
|
||||
assert MockPasteModule({1337: '', 42: '', False: ''}).get_closest_expiration(1338) is 1337
|
||||
# this format should work, though of doubtful usage
|
||||
assert MockPasteBackend([1337, 42, False]).get_closest_expiration(84) is 42
|
||||
assert MockPasteModule([1337, 42, False]).get_closest_expiration(84) is 42
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue