ó b@RTc@s$dZddlZddlZddlmZmZmZmZyddlZeWne k rsddl ZnXde fd„ƒYZ de fd„ƒYZ d „Zd „Zddd „Zd efd „ƒYZdejejfd„ƒYZd„Zd„Zded„Zd„ZdS(sŠ 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((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pyt__init__!s  cCs|jS(N(R (R ((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pytget_type&scCst|jjƒjS(N(RRRtnetloc(R ((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pytget_host)scCs |jƒS(N(R(R ((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pytget_origin_req_host,scCsl|jjjdƒs|jjS|jjd}t|jjƒ}t|j||j|j|j |j gƒS(NtHost( RtheaderstgetRRRRtpathtparamstquerytfragment(R thosttparsed((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pyt get_full_url/s cCstS(N(tTrue(R ((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pytis_unverifiable=scCs||jjkp||jkS(N(RRR(R tname((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pyt has_header@scCs%|jjj||jj||ƒƒS(N(RRRR(R Rtdefault((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pyt get_headerCscCstdƒ‚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((s=/opt/freeware/lib/python2.7/site-packages/requests/cookies.pyt add_headerFscCs||j|s&  "  H   #