don't need to logout from dlfp if the browser hasn't been used
This commit is contained in:
parent
fd2bb8abb1
commit
bbd7b66413
2 changed files with 7 additions and 1 deletions
|
|
@ -50,6 +50,10 @@ class DLFPBackend(BaseBackend, ICapMessages, ICapMessagesPost):
|
||||||
return self.create_browser(self.config['username'], self.config['password'])
|
return self.create_browser(self.config['username'], self.config['password'])
|
||||||
|
|
||||||
def deinit(self):
|
def deinit(self):
|
||||||
|
# don't need to logout if the browser hasn't been used.
|
||||||
|
if not self._browser:
|
||||||
|
return
|
||||||
|
|
||||||
with self.browser:
|
with self.browser:
|
||||||
self.browser.close_session()
|
self.browser.close_session()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,8 @@ class BaseBackend(object):
|
||||||
else:
|
else:
|
||||||
return xdg.IconTheme.getIconPath(klass.NAME)
|
return xdg.IconTheme.getIconPath(klass.NAME)
|
||||||
|
|
||||||
|
_browser = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def browser(self):
|
def browser(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -160,7 +162,7 @@ class BaseBackend(object):
|
||||||
|
|
||||||
Note that the 'create_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'):
|
if self._browser is None:
|
||||||
self._browser = self.create_default_browser()
|
self._browser = self.create_default_browser()
|
||||||
return self._browser
|
return self._browser
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue