ó `8(Zc@sEdZddlZddlZddlZddlZddlmZmZmZm Z yddl Z e Wne k r‹ddl Z nXde fd„ƒYZde fd„ƒYZd „Zd „Zddd „Zd efd „ƒYZdejejfd„ƒYZd„Zd„Zd„Zded„Zd„ZdS(s­ requests.cookies ~~~~~~~~~~~~~~~~ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. iÿÿÿÿNi(t cookielibturlparset urlunparsetMorselt MockRequestcBs¡eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z dd„Z d „Z d „Z d „Zed „ƒZed „ƒZed„ƒZRS(sòWraps a `requests.Request` to mimic a `urllib2.Request`. The code in `cookielib.CookieJar` expects this interface in order to correctly manage cookie policies, i.e., determine whether a cookie can be set, given the domains of the request and the cookie. The original request object is read-only. The client is responsible for collecting the new headers via `get_new_headers()` and interpreting them appropriately. You probably want `get_cookie_header`, defined below. cCs.||_i|_t|jjƒj|_dS(N(t_rt _new_headersRturltschemettype(tselftrequest((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pyt__init__&s  cCs|jS(N(R (R ((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pytget_type+scCst|jjƒjS(N(RRRtnetloc(R ((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pytget_host.scCs |jƒS(N(R(R ((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pytget_origin_req_host1scCsl|jjjdƒs|jjS|jjd}t|jjƒ}t|j||j|j|j |j gƒS(NtHost( RtheaderstgetRRRRtpathtparamstquerytfragment(R thosttparsed((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pyt get_full_url4s cCstS(N(tTrue(R ((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pytis_unverifiableBscCs||jjkp||jkS(N(RRR(R tname((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pyt has_headerEscCs%|jjj||jj||ƒƒS(N(RRRR(R Rtdefault((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pyt get_headerHscCstdƒ‚dS(sMcookielib has no legitimate use for this method; add it back if you find one.s=Cookie headers should be added with add_unredirected_header()N(tNotImplementedError(R tkeytval((s9/tmp/pip-build-0nEYGB/pip/pip/_vendor/requests/cookies.pyt add_headerKscCs||j| s,    "  H  ø  #