ó
µ”‹]c        	   @` sÃ  d  d l  m Z d  d l  m Z d  d l  m Z d  d l  m Z d  d l Z d  d l Z y d  d l m Z Wn! e	 k
 r d  d l
 m Z n Xy d  d l
 m Z Wn! e	 k
 rÇ d  d l m Z n Xy d  d l
 m Z Wn! e	 k
 rÿ d  d l m Z n Xy d  d l Z Wn e	 k
 r)d Z n Xd  d	 l m Z d  d l Z y d  d
 l m Z WnI e	 k
 r¥y d  d
 l m Z Wq¦e	 k
 r¡d  d
 l m Z q¦Xn Xd d d g Z e j d  d k Z e j d  d k Z e Z e d ƒ Z d „  Z d d „ Z d e f d „  ƒ  YZ  y d  d l
 m! Z! Wn e	 k
 rEe  Z! n Xe" e d e j# e d ƒ e$ f e% d e j# ƒ ƒ ƒ Z& d e& f d „  ƒ  YZ' e" e d e' ƒ Z( d „  Z) e" e d e) ƒ Z* d S(   i    (   t   absolute_import(   t   division(   t   print_function(   t   unicode_literalsN(   t   MutableMapping(   t   UserDict(   t   OrderedDict(   t   open(   t	   get_identu   UserDictu   OrderedDictu   openi   i   u   strc         C` s   d |  _ t |  _ |  S(   uC   raise from_none(ValueError('a')) == raise ValueError('a') from NoneN(   t   Nonet	   __cause__t   Truet   __suppress_context__(   t   exc(    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt	   from_none6   s    		u   ...c         ` s   ‡  f d †  } | S(   uG   Decorator to make a repr function return fillvalue for a recursive callc         ` sm   t  ƒ  ‰  ‡ ‡  ‡ f d †  } t ˆ d ƒ | _ t ˆ d ƒ | _ t ˆ d ƒ | _ t ˆ d i  ƒ | _ | S(   Nc         ` sW   t  |  ƒ t ƒ  f } | ˆ k r% ˆ  Sˆ j | ƒ z ˆ |  ƒ } Wd  ˆ j | ƒ X| S(   N(   t   idR   t   addt   discard(   t   selft   keyt   result(   t	   fillvaluet   repr_runningt   user_function(    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   wrapperD   s    u
   __module__u   __doc__u   __name__u   __annotations__(   t   sett   getattrt
   __module__t   __doc__t   __name__t   __annotations__(   R   R   (   R   (   R   R   s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   decorating_functionA   s    	(    (   R   R   (    (   R   s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   recursive_repr>   s    t	   _ChainMapc           B` sÅ   e  Z d  Z d „  Z d „  Z d „  Z d d „ Z d „  Z d „  Z	 d „  Z
 e ƒ  d „  ƒ Z e d	 „  ƒ Z d
 „  Z e Z d „  Z e d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   u±   A ChainMap groups multiple dicts (or other mappings) together
    to create a single, updateable view.

    The underlying mappings are stored in a list.  That list is public and can
    accessed or updated using the *maps* attribute.  There is no other state.

    Lookups search the underlying mappings successively until a key is found.
    In contrast, writes, updates, and deletions only operate on the first
    mapping.

    c         G` s   t  | ƒ p i  g |  _ d S(   u   Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        N(   t   listt   maps(   R   R#   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __init__g   s    c         C` s   t  | ƒ ‚ d  S(   N(   t   KeyError(   R   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __missing__n   s    c         C` sA   x1 |  j  D]& } y | | SWq
 t k
 r/ q
 Xq
 W|  j | ƒ S(   N(   R#   R%   R&   (   R   R   t   mapping(    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __getitem__q   s    c         C` s   | |  k r |  | S| S(   N(    (   R   R   t   default(    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   get{   s    c         C` s   t  t ƒ  j |  j Œ  ƒ S(   N(   t   lenR   t   unionR#   (   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __len__~   s    c         C` s   t  t ƒ  j |  j Œ  ƒ S(   N(   t   iterR   R,   R#   (   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __iter__‚   s    c         ` s   t  ‡  f d †  |  j Dƒ ƒ S(   Nc         3` s   |  ] } ˆ  | k Vq d  S(   N(    (   t   .0t   m(   R   (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pys	   <genexpr>†   s    (   t   anyR#   (   R   R   (    (   R   s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __contains__…   s    c         C` s%   d j  |  d j t t |  j ƒ ƒ ƒ S(   Nu   {0.__class__.__name__}({1})u   , (   t   formatt   joint   mapt   reprR#   (   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __repr__ˆ   s    c         G` s   |  t  j | | Œ ƒ S(   u?   Create a ChainMap with a single dict created from the iterable.(   t   dictt   fromkeys(   t   clst   iterablet   args(    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyR:   Ž   s    c         C` s$   |  j  |  j d j ƒ  |  j d Œ S(   ub   
        New ChainMap or subclass with a new copy of
        maps[0] and refs to maps[1:]
        i    i   (   t	   __class__R#   t   copy(   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyR?   “   s    c         C` s   |  j  i  |  j Œ S(   u;   New ChainMap with a new dict followed by all previous maps.(   R>   R#   (   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt	   new_childœ   s    c         C` s   |  j  |  j d Œ  S(   u   New ChainMap from maps[1:].i   (   R>   R#   (   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   parents    s    c         C` s   | |  j  d | <d  S(   Ni    (   R#   (   R   R   t   value(    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __setitem__¥   s    c         C` s?   y |  j  d | =Wn& t k
 r: t d j | ƒ ƒ ‚ n Xd  S(   Ni    u(   Key not found in the first mapping: {!r}(   R#   R%   R4   (   R   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __delitem__¨   s    c         C` s9   y |  j  d j ƒ  SWn t k
 r4 t d ƒ ‚ n Xd S(   uj   
        Remove and return an item pair from maps[0].
        Raise KeyError is maps[0] is empty.
        i    u#   No keys found in the first mapping.N(   R#   t   popitemR%   (   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyRE   ®   s    c         G` sH   y |  j  d j | | Œ SWn& t k
 rC t d j | ƒ ƒ ‚ n Xd S(   uq   
        Remove *key* from maps[0] and return its value.
        Raise KeyError if *key* not in maps[0].
        i    u(   Key not found in the first mapping: {!r}N(   R#   t   popR%   R4   (   R   R   R=   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyRF   ¸   s    c         C` s   |  j  d j ƒ  d S(   u'   Clear maps[0], leaving maps[1:] intact.i    N(   R#   t   clear(   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyRG   Ã   s    N(   R   R   R   R$   R&   R(   R	   R*   R-   R/   R3   R    R8   t   classmethodR:   R?   t   __copy__R@   t   propertyRA   RC   RD   RE   RF   RG   (    (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyR!   Z   s&   			
								
	(   t   ChainMapu   ABCu   __ABCt   __metaclass__t	   _PathLikec           B` s/   e  Z d  Z e j d „  ƒ Z e d „  ƒ Z RS(   uC   Abstract base class for implementing the file system path protocol.c         C` s
   t  ‚ d S(   u9   Return the file system path representation of the object.N(   t   NotImplementedError(   R   (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt
   __fspath__Ú   s    c         C` s+   t  t | d ƒ p' t o' t | t j ƒ ƒ S(   Nu
   __fspath__(   t   boolt   hasattrt   pathlibt
   issubclasst   Path(   R;   t   subclass(    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   __subclasshook__ß   s    (   R   R   R   t   abct   abstractmethodRO   RH   RV   (    (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyRM   Ö   s   u   PathLikec         C` sá   t  |  t t f ƒ r |  St |  d ƒ rE t  |  t j ƒ rE t |  ƒ St |  ƒ } y | j |  ƒ } Wn9 t k
 rŸ t | d ƒ r‰ ‚  q  t	 d | j
 ƒ ‚ n Xt  | t t f ƒ r¹ | St	 d j | j
 t | ƒ j
 ƒ ƒ ‚ d S(   ua  Return the path representation of a path-like object.

    If str or bytes is passed in, it is returned unchanged. Otherwise the
    os.PathLike interface is used to get the path representation. If the
    path representation is not str or bytes, TypeError is raised. If the
    provided path is not str, bytes, or os.PathLike, TypeError is raised.
    u
   __fspath__u/   expected str, bytes or os.PathLike object, not u7   expected {}.__fspath__() to return str or bytes, not {}N(   t
   isinstancet   strt   bytesRQ   RR   RT   t   typeRO   t   AttributeErrort	   TypeErrorR   R4   (   t   patht	   path_typet	   path_repr(    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   _fspathì   s$    "
u   fspath(+   t
   __future__R    R   R   R   RW   t   ost   collections.abcR   t   ImportErrort   collectionsR   R   t   ordereddictRR   R	   t   ioR   t   syst   threadR   t   _threadt   _dummy_threadt   __all__t   version_infot   PY2t   PY3RZ   t
   native_strR\   R   R    R!   RK   R   t   ABCMetat   objectR9   t   _ABCRM   t   PathLikeRb   t   fspath(    (    (    s=   lib/python2.7/site-packages/backports/configparser/helpers.pyt   <module>   sd   
	n
-	&