renames
This commit is contained in:
parent
d319625288
commit
ca7d37e3cb
7 changed files with 17 additions and 17 deletions
|
|
@ -55,8 +55,8 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesReply, ICapDating, ICapC
|
|||
}
|
||||
BROWSER = AuMBrowser
|
||||
|
||||
def default_browser(self):
|
||||
return self.build_browser(self.config['username'], self.config['password'])
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['username'], self.config['password'])
|
||||
|
||||
def get_status(self):
|
||||
with self.browser:
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class BNPorcBackend(BaseBackend, ICapBank):
|
|||
}
|
||||
BROWSER = BNPorc
|
||||
|
||||
def default_browser(self):
|
||||
return self.build_browser(self.config['login'], self.config['password'])
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['login'], self.config['password'])
|
||||
|
||||
def iter_accounts(self):
|
||||
for account in self.browser.get_accounts_list():
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class CragrBackend(BaseBackend, ICapBank):
|
|||
}
|
||||
BROWSER = Cragr
|
||||
|
||||
def default_browser(self):
|
||||
return self.build_browser(self.config['website'], self.config['login'], self.config['password'])
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['website'], self.config['login'], self.config['password'])
|
||||
|
||||
def iter_accounts(self):
|
||||
for account in self.browser.get_accounts_list():
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesReply):
|
|||
STORAGE = {'seen': {}}
|
||||
BROWSER = DLFP
|
||||
|
||||
def default_browser(self):
|
||||
return self.build_browser(self.config['username'], self.config['password'])
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['username'], self.config['password'])
|
||||
|
||||
def iter_messages(self, thread=None):
|
||||
return self._iter_messages(thread, False)
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ class GazelleBackend(BaseBackend, ICapTorrent):
|
|||
}
|
||||
BROWSER = GazelleBrowser
|
||||
|
||||
def default_browser(self):
|
||||
return self.build_browser(self.config['protocol'], self.config['domain'],
|
||||
self.config['username'], self.config['password'])
|
||||
def create_default_browser(self):
|
||||
return self.create_browser(self.config['protocol'], self.config['domain'],
|
||||
self.config['username'], self.config['password'])
|
||||
|
||||
def get_torrent(self, id):
|
||||
return self.browser.get_torrent(id)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
import sys
|
||||
if sys.version_info[:2] <= (2, 5):
|
||||
import weboob.tools.property
|
||||
from weboob.tools import property
|
||||
|
||||
|
||||
from .cap import ICap
|
||||
|
|
|
|||
|
|
@ -127,20 +127,20 @@ class BaseBackend(object):
|
|||
Attribute 'browser'. The browser is created at the first call
|
||||
of this attribute, to avoid useless pages access.
|
||||
|
||||
Note that the 'default_browser' method is called to create it.
|
||||
Note that the 'create_default_browser' method is called to create it.
|
||||
"""
|
||||
if not hasattr(self, '_browser'):
|
||||
self._browser = self.default_browser()
|
||||
self._browser = self.create_default_browser()
|
||||
return self._browser
|
||||
|
||||
def default_browser(self):
|
||||
def create_default_browser(self):
|
||||
"""
|
||||
Method to overload to build the default browser in
|
||||
attribute 'browser'.
|
||||
"""
|
||||
return self.build_browser()
|
||||
return self.create_browser()
|
||||
|
||||
def build_browser(self, *args, **kwargs):
|
||||
def create_browser(self, *args, **kwargs):
|
||||
"""
|
||||
Build a browser from the BROWSER class attribute and the
|
||||
given arguments.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue