usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pyc000064400000006377147205663700020604 0ustar00 abc@@sddlmZddlZddlmZddlmZddlmZddl m Z ddl m Z ej d d Zd Zd Zd ZddZdS(i(tabsolute_importN(tuuid4(tBytesIOi(tsix(tb(t RequestFieldsutf-8icC@s tjS(sN Our embarrassingly-simple replacement for mimetools.choose_boundary. (Rthex(((s@/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pytchoose_boundaryscc@sgt|tr!tj|}n t|}x3|D]+}t|trQ|Vq4tj|Vq4WdS(s Iterate over fields. Supports list of (k, v) tuples and dicts, and lists of :class:`~urllib3.fields.RequestField`. N(t isinstancetdictRt iteritemstiterRt from_tuples(tfieldstitfield((s@/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pytiter_field_objectss  cC@s4t|tr&dtj|DSd|DS(s- .. deprecated:: 1.6 Iterate over fields. The addition of :class:`~urllib3.fields.RequestField` makes this function obsolete. Instead, use :func:`iter_field_objects`, which returns :class:`~urllib3.fields.RequestField` objects. Supports list of (k, v) tuples and dicts. cs@s!|]\}}||fVqdS(N((t.0tktv((s@/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pys 6scs@s!|]\}}||fVqdS(N((RRR((s@/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pys 8s(RR RR (R ((s@/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pyt iter_fields)s cC@st}|dkr!t}nxt|D]}|jtd|t|j|j|j}t |t rt |}nt |t j rt|j|n |j||jdq.W|jtd|t d|}|j|fS(sJ Encode a dictionary of ``fields`` using the multipart/form-data MIME format. :param fields: Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). :param boundary: If not specified, then a random boundary will be generated using :func:`mimetools.choose_boundary`. s--%s s s--%s-- s multipart/form-data; boundary=%sN(RtNoneRRtwriteRtwritertrender_headerstdataRtinttstrRt text_typetgetvalue(R tboundarytbodyRRt content_type((s@/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pytencode_multipart_formdata;s     (t __future__RtcodecstuuidRtioRtpackagesRt packages.sixRR RtlookupRRRRRR!(((s@/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/filepost.pyts