Commit 6fc85b32 authored by Romain Bignon's avatar Romain Bignon

can use need_login and StatesMixin without a PagesBrowser

parent 280bc7f8
......@@ -769,7 +769,7 @@ def need_login(func):
def inner(browser, *args, **kwargs):
if (not hasattr(browser, 'logged') or (hasattr(browser, 'logged') and not browser.logged)) and \
( is None or not
(not hasattr(browser, 'page') or is None or not
browser.logger.debug('logged in with session: %s', json.dumps(browser.export_session()))
return func(browser, *args, **kwargs)
......@@ -844,7 +844,7 @@ class StatesMixin(object):
def dump_state(self):
state = {}
if hasattr(self, 'page') and
state['url'] =
state['cookies'] = base64.b64encode(zlib.compress(pickle.dumps(self.session.cookies, -1)))
for attrname in self.__states__:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment