fix backends initialization

This commit is contained in:
Romain Bignon 2010-03-30 23:30:58 +02:00
commit 7d274c74b7
6 changed files with 4 additions and 15 deletions

View file

@ -25,8 +25,9 @@ class Backend:
VERSION = '<unspecified>'
LICENSE = '<unspecified>'
def __init__(self, weboob):
def __init__(self, weboob, config):
self.weboob = weboob
self.config = config
def has_caps(self, *caps):
for c in caps:

View file

@ -27,8 +27,5 @@ class AuMBackend(Backend, ICapMessages, ICapMessagesReply):
VERSION = '1.0'
LICENSE = 'GPLv3'
def __init__(self, weboob):
Backend.__init__(self, weboob)
def iter_messages(self, thread=None):
return dict().iteritems()

View file

@ -29,9 +29,6 @@ class CanalTPBackend(Backend, ICapTravel):
VERSION = '1.0'
LICENSE = 'GPLv3'
def __init__(self, weboob):
Backend.__init__(self, weboob)
def iter_station_search(self, pattern):
canaltp = CanalTP()
for _id, name in canaltp.iter_station_search(pattern):

View file

@ -29,9 +29,6 @@ class DLFPBackend(Backend, ICapMessages, ICapMessagesReply, ICapUpdatable):
VERSION = '1.0'
LICENSE = 'GPLv3'
def __init__(self, weboob):
Backend.__init__(self, weboob)
def iter_messages(self):
articles_list = ArticlesList('newspaper')
for article in articles_list.iter_articles():

View file

@ -30,9 +30,6 @@ class TransilienBackend(Backend, ICapTravel):
VERSION = '1.0'
LICENSE = 'GPLv3'
def __init__(self, weboob):
Backend.__init__(self, weboob)
def iter_station_search(self, pattern):
pattern = pattern.lower()
for _id, name in STATIONS.iteritems():

View file

@ -45,8 +45,8 @@ class Module:
return True
return False
def create_backend(self, weboob):
return self.klass(weboob)
def create_backend(self, weboob, config):
return self.klass(weboob, config)
class ModulesLoader:
def __init__(self):