woob.browser.sessions
¶
-
class
woob.browser.sessions.
FuturesSession
(executor=None, max_workers=2, max_retries=2, *args, **kwargs)¶ Bases:
woob.browser.sessions.WoobSession
Creates a FuturesSession
ProcessPoolExecutor is not supported b/c Response objects are not picklable.
If you provide both executor and max_workers, the latter is ignored and provided executor is used as is.
-
close
()¶ Closes all adapters and as such the session
-
send
(*args, **kwargs)¶ Maintains the existing api for
Session.send()
Used by
request()
and thus all of the higher level methodsIf the is_async param is True, the request is processed in a thread. Otherwise, the request is processed as usual, in a blocking way.
In all cases, it will call the callback parameter and return its result when the request has been processed.
-
woob.browser.sessions.
WeboobSession
¶ alias of
woob.browser.sessions.WoobSession
-
class
woob.browser.sessions.
WoobSession
¶ Bases:
requests.sessions.Session
-
prepare_request
(request)¶ Constructs a
PreparedRequest
for transmission and returns it. ThePreparedRequest
has settings merged from theRequest
instance and those of theSession
.- Parameters
request –
Request
instance to prepare with this session’s settings.
-
-
woob.browser.sessions.
merge_hooks
(request_hooks, session_hooks, dict_class=<class 'collections.OrderedDict'>)¶ Properly merges both requests and session hooks.
This is necessary because when request_hooks == {‘response’: []}, the merge breaks Session hooks entirely.
Backport from request so we can use it in wheezy