new API in BaseBackend to create browser

This commit is contained in:
Romain Bignon 2010-05-20 10:39:49 +02:00
commit c1279aa496
12 changed files with 84 additions and 87 deletions

View file

@ -47,18 +47,14 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesReply, ICapDating, ICapC
'password': BaseBackend.ConfigField(description='Password of account', is_masked=True),
}
STORAGE = {'profiles_walker': {'viewed': []} }
BROWSER = AdopteUnMec
def default_browser(self):
return self.build_browser(self.config['username'], self.config['password'])
# Private
_browser = None
_profiles_walker = None
def __getattr__(self, name):
if name == 'browser':
if not self._browser:
self._browser = AdopteUnMec(self.config['username'], self.config['password'])
return self._browser
raise AttributeError, name
def iter_messages(self, thread=None):
for message in self._iter_messages(thread, False):
yield message