관리-도구
편집 파일: structures.cpython-33.pyc
� 7�Re� c @ sw d Z d d l Z d d l Z d d l m Z Gd d � d e � Z Gd d � d e j � Z Gd d � d e � Z d S( uP requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. i N( u islicec B sJ | Ee Z d Z d Z d d � Z d d � Z d d � Z d d � Z d S( u IteratorProxyu docstring for IteratorProxyc C s | | _ d S( N( u i( u selfu i( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __init__ s u IteratorProxy.__init__c C s | j S( N( u i( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __iter__ s u IteratorProxy.__iter__c C sj t | j d � r t | j � St | j d � r; | j j St | j d � rf t j | j j � � j Sd S( Nu __len__u lenu fileno( u hasattru iu lenu osu fstatu filenou st_size( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __len__ s u IteratorProxy.__len__c C s d j t | j d | � � S( Nu ( u joinu isliceu iu None( u selfu n( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu read! s u IteratorProxy.readN( u __name__u __module__u __qualname__u __doc__u __init__u __iter__u __len__u read( u __locals__( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu IteratorProxy s u IteratorProxyc B s� | Ee Z d Z d Z d d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d S( u CaseInsensitiveDictu� A case-insensitive ``dict``-like object. Implements all methods and operations of ``collections.MutableMapping`` as well as dict's ``copy``. Also provides ``lower_items``. All keys are expected to be strings. The structure remembers the case of the last key to be set, and ``iter(instance)``, ``keys()``, ``items()``, ``iterkeys()``, and ``iteritems()`` will contain case-sensitive keys. However, querying and contains testing is case insensitive: cid = CaseInsensitiveDict() cid['Accept'] = 'application/json' cid['aCCEPT'] == 'application/json' # True list(cid) == ['Accept'] # True For example, ``headers['content-encoding']`` will return the value of a ``'Content-Encoding'`` response header, regardless of how the header name was originally stored. If the constructor, ``.update``, or equality comparison operations are given keys that have equal ``.lower()``s, the behavior is undefined. c K s5 t � | _ | d k r! i } n | j | | � d S( N( u dictu _storeu Noneu update( u selfu datau kwargs( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __init__A s u CaseInsensitiveDict.__init__c C s | | f | j | j � <d S( N( u _storeu lower( u selfu keyu value( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __setitem__G s u CaseInsensitiveDict.__setitem__c C s | j | j � d S( Ni ( u _storeu lower( u selfu key( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __getitem__L s u CaseInsensitiveDict.__getitem__c C s | j | j � =d S( N( u _storeu lower( u selfu key( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __delitem__O s u CaseInsensitiveDict.__delitem__c C s d d � | j j � D� S( Nc s s | ] \ } } | Vq d S( N( ( u .0u casedkeyu mappedvalue( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu <genexpr>S s u/ CaseInsensitiveDict.__iter__.<locals>.<genexpr>( u _storeu values( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __iter__R s u CaseInsensitiveDict.__iter__c C s t | j � S( N( u lenu _store( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __len__U s u CaseInsensitiveDict.__len__c C s d d � | j j � D� S( u. Like iteritems(), but with all lowercase keys.c s s% | ] \ } } | | d f Vq d S( i N( ( u .0u lowerkeyu keyval( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu <genexpr>[ s u2 CaseInsensitiveDict.lower_items.<locals>.<genexpr>( u _storeu items( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu lower_itemsX s u CaseInsensitiveDict.lower_itemsc C sG t | t j � r! t | � } n t St | j � � t | j � � k S( N( u isinstanceu collectionsu Mappingu CaseInsensitiveDictu NotImplementedu dictu lower_items( u selfu other( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __eq__` s u CaseInsensitiveDict.__eq__c C s t | j j � � S( N( u CaseInsensitiveDictu _storeu values( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu copyi s u CaseInsensitiveDict.copyc C s t t | j � � � S( N( u stru dictu items( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __repr__l s u CaseInsensitiveDict.__repr__N( u __name__u __module__u __qualname__u __doc__u Noneu __init__u __setitem__u __getitem__u __delitem__u __iter__u __len__u lower_itemsu __eq__u copyu __repr__( u __locals__( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu CaseInsensitiveDict% s u CaseInsensitiveDictc sV | Ee Z d Z d Z d � f d d � Z d d � Z d d � Z d d d � Z � S( u LookupDictu Dictionary lookup object.c s | | _ t t | � j � d S( N( u nameu superu LookupDictu __init__( u selfu name( u __class__( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __init__r s u LookupDict.__init__c C s d | j S( Nu <lookup '%s'>( u name( u self( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __repr__v s u LookupDict.__repr__c C s | j j | d � S( N( u __dict__u getu None( u selfu key( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu __getitem__y s u LookupDict.__getitem__c C s | j j | | � S( N( u __dict__u get( u selfu keyu default( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu get~ s u LookupDict.getN( u __name__u __module__u __qualname__u __doc__u Noneu __init__u __repr__u __getitem__u get( u __locals__( ( u __class__u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu LookupDicto s u LookupDict( u __doc__u osu collectionsu itertoolsu isliceu objectu IteratorProxyu MutableMappingu CaseInsensitiveDictu dictu LookupDict( ( ( u8 /tmp/pip-zej_zi-build/pip/_vendor/requests/structures.pyu <module> s J