weboob.browser.sessions

class weboob.browser.sessions.FuturesSession(executor=None, max_workers=2, max_retries=2, *args, **kwargs)

Bases: weboob.browser.sessions.WeboobSession

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()
send(*args, **kwargs)

Maintains the existing api for Session.send()

Used by request() and thus all of the higher level methods

If 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.

class weboob.browser.sessions.WeboobSession

Bases: requests.sessions.Session

prepare_request(request)

Constructs a PreparedRequest for transmission and returns it. The PreparedRequest has settings merged from the Request instance and those of the Session.

Parameters:requestRequest instance to prepare with this session’s settings.
weboob.browser.sessions.merge_hooks(request_hooks, session_hooks, dict_class=<class 'requests.packages.urllib3.packages.ordered_dict.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