ó
è¾bc           @   s½  d  Z  y d d l m Z Wn e k
 r3 e Z n Xd d l Z d d d d d d	 d
 d d d d d d g Z d Z d Z	 d e
 f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e f d „  ƒ  YZ d e f d „  ƒ  YZ d
 e f d „  ƒ  YZ d e f d „  ƒ  YZ d f  d „  ƒ  YZ d d l Z d  e j f d! „  ƒ  YZ d e f d" „  ƒ  YZ d e f d# „  ƒ  YZ d S($   s  Configuration file parser.

A setup file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

The option values can contain format strings which refer to other values in
the same section, or values in a special [DEFAULT] section.

For example:

    something: %(dir)s/whatever

would resolve the "%(dir)s" to the value of dir.  All reference
expansions are done late, on demand.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
                configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None)
        create the parser and specify a dictionary of intrinsic defaults.  The
        keys must be strings, the values must be appropriate for %()s string
        interpolation.  Note that `__name__' is always an intrinsic default;
        its value is the section's name.

    sections()
        return all the configuration section names, sans DEFAULT

    has_section(section)
        return whether the given section exists

    has_option(section, option)
        return whether the given option exists in the given section

    options(section)
        return list of configuration options for the named section

    read(filenames)
        read and parse the list of named configuration files, given by
        name.  A single filename is also allowed.  Non-existing files
        are ignored.  Return list of successfully read files.

    readfp(fp, filename=None)
        read and parse one configuration file, given as a file object.
        The filename defaults to fp.name; it is only used in error
        messages (if fp has no `name' attribute, the string `<???>' is used).

    get(section, option, raw=False, vars=None)
        return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults.

    getint(section, options)
        like get(), but convert value to an integer

    getfloat(section, options)
        like get(), but convert value to a float

    getboolean(section, options)
        like get(), but convert value to a boolean (currently case
        insensitively defined as 0, false, no, off for False, and 1, true,
        yes, on for True).  Returns False or True.

    items(section, raw=False, vars=None)
        return a list of tuples with (name, value) for each option
        in the section.

    remove_section(section)
        remove the given file section and all its options

    remove_option(section, option)
        remove the given option from the given section

    set(section, option, value)
        set the given option

    write(fp)
        write the configuration state in .ini format
iÿÿÿÿ(   t   OrderedDictNt   NoSectionErrort   DuplicateSectionErrort   NoOptionErrort   InterpolationErrort   InterpolationDepthErrort   InterpolationSyntaxErrort   ParsingErrort   MissingSectionHeaderErrort   ConfigParsert   SafeConfigParsert   RawConfigParsert   DEFAULTSECTt   MAX_INTERPOLATION_DEPTHt   DEFAULTi
   t   Errorc           B   sJ   e  Z d  Z d „  Z d „  Z e e e ƒ Z d d „ Z d „  Z e Z	 RS(   s'   Base class for ConfigParser exceptions.c         C   s   |  j  S(   sS   Getter for 'message'; needed only to override deprecation in
        BaseException.(   t   _Error__message(   t   self(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   _get_messages   s    c         C   s   | |  _  d S(   sS   Setter for 'message'; needed only to override deprecation in
        BaseException.N(   R   (   R   t   value(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   _set_messagex   s    t    c         C   s   | |  _  t j |  | ƒ d  S(   N(   t   messaget	   Exceptiont   __init__(   R   t   msg(    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ‚   s    	c         C   s   |  j  S(   N(   R   (   R   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   __repr__†   s    (
   t   __name__t
   __module__t   __doc__R   R   t   propertyR   R   R   t   __str__(    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   p   s   			c           B   s   e  Z d  Z d „  Z RS(   s2   Raised when no section matches a requested option.c         C   s0   t  j |  d | f ƒ | |  _ | f |  _ d  S(   Ns   No section: %r(   R   R   t   sectiont   args(   R   R    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   Ž   s    	(   R   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ‹   s   c           B   s   e  Z d  Z d „  Z RS(   s*   Raised when a section is multiply-created.c         C   s-   t  j |  d | ƒ | |  _ | f |  _ d  S(   Ns   Section %r already exists(   R   R   R    R!   (   R   R    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   –   s    	(   R   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   “   s   c           B   s   e  Z d  Z d „  Z RS(   s!   A requested option was not found.c         C   s?   t  j |  d | | f ƒ | |  _ | |  _ | | f |  _ d  S(   Ns   No option %r in section: %r(   R   R   t   optionR    R!   (   R   R"   R    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ž   s
    		(   R   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ›   s   c           B   s   e  Z d  Z d „  Z RS(   s0   Base class for interpolation-related exceptions.c         C   s8   t  j |  | ƒ | |  _ | |  _ | | | f |  _ d  S(   N(   R   R   R"   R    R!   (   R   R"   R    R   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ¨   s    		(   R   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ¥   s   t   InterpolationMissingOptionErrorc           B   s   e  Z d  Z d „  Z RS(   sA   A string substitution required a setting which was not available.c         C   sN   d | | | | f } t  j |  | | | ƒ | |  _ | | | | f |  _ d  S(   NsN   Bad value substitution:
	section: [%s]
	option : %s
	key    : %s
	rawval : %s
(   R   R   t	   referenceR!   (   R   R"   R    t   rawvalR$   R   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ±   s
    	(   R   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR#   ®   s   c           B   s   e  Z d  Z RS(   sj   Raised when the source text into which substitutions are made
    does not conform to the required syntax.(   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ¼   s   c           B   s   e  Z d  Z d „  Z RS(   s0   Raised when substitutions are nested too deeply.c         C   s?   d | | | f } t  j |  | | | ƒ | | | f |  _ d  S(   NsS   Value interpolation too deeply recursive:
	section: [%s]
	option : %s
	rawval : %s
(   R   R   R!   (   R   R"   R    R%   R   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   Ã   s    (   R   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   À   s   c           B   s    e  Z d  Z d „  Z d „  Z RS(   s>   Raised when a configuration file does not follow legal syntax.c         C   s6   t  j |  d | ƒ | |  _ g  |  _ | f |  _ d  S(   Ns    File contains parsing errors: %s(   R   R   t   filenamet   errorsR!   (   R   R&   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   Ï   s    		c         C   s3   |  j  j | | f ƒ |  j d | | f 7_ d  S(   Ns   
	[line %2d]: %s(   R'   t   appendR   (   R   t   linenot   line(    (    s"   /usr/lib/python2.7/ConfigParser.pyR(   Õ   s    (   R   R   R   R   R(   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   Ì   s   	c           B   s   e  Z d  Z d „  Z RS(   s@   Raised when a key-value pair is found before any section header.c         C   sN   t  j |  d | | | f ƒ | |  _ | |  _ | |  _ | | | f |  _ d  S(   Ns7   File contains no section headers.
file: %s, line: %d
%r(   R   R   R&   R)   R*   R!   (   R   R&   R)   R*   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   Ü   s    			(   R   R   R   R   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   Ù   s   c           B   s?  e  Z d  e e d  „ Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d  d „ Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z i e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6Z d „  Z d „  Z d „  Z d  d „ Z d „  Z d „  Z d „  Z e j d ƒ Z e j d ƒ Z e j d ƒ Z d „  Z  RS(!   c         C   sˆ   | |  _  |  j  ƒ  |  _ |  j  ƒ  |  _ | r< |  j |  _ n |  j |  _ | r„ x3 | j ƒ  D]" \ } } | |  j |  j | ƒ <q[ Wn  d  S(   N(   t   _dictt	   _sectionst	   _defaultst	   OPTCRE_NVt   _optcret   OPTCREt   itemst   optionxform(   R   t   defaultst	   dict_typet   allow_no_valuet   keyR   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   è   s    	c         C   s   |  j  S(   N(   R-   (   R   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR3   õ   s    c         C   s   |  j  j ƒ  S(   s3   Return a list of section names, excluding [DEFAULT](   R,   t   keys(   R   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   sectionsø   s    c         C   sW   | j  ƒ  d k r" t d | ‚ n  | |  j k r@ t | ƒ ‚ n  |  j ƒ  |  j | <d S(   sé   Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists. Raise ValueError if name is DEFAULT or any of it's
        case-insensitive variants.
        t   defaults   Invalid section name: %sN(   t   lowert
   ValueErrorR,   R   R+   (   R   R    (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   add_sectioný   s
    c         C   s   | |  j  k S(   s~   Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        (   R,   (   R   R    (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   has_section  s    c         C   sg   y |  j  | j ƒ  } Wn t k
 r6 t | ƒ ‚ n X| j |  j ƒ d | k r] | d =n  | j ƒ  S(   s9   Return a list of option names for the given section name.R   (   R,   t   copyt   KeyErrorR   t   updateR-   R7   (   R   R    t   opts(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   options  s    
c         C   s„   t  | t ƒ r | g } n  g  } x\ | D]T } y t | ƒ } Wn t k
 rT q( n X|  j | | ƒ | j ƒ  | j | ƒ q( W| S(   sÔ  Read and parse a filename or a list of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify a list of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the list will be read.  A single
        filename may also be given.

        Return list of successfully read files.
        (   t
   isinstancet
   basestringt   opent   IOErrort   _readt   closeR(   (   R   t	   filenamest   read_okR&   t   fp(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   read  s    
c         C   sJ   | d k r6 y | j } Wq6 t k
 r2 d } q6 Xn  |  j | | ƒ d S(   s  Like read() but the argument must be a file-like object.

        The `fp' argument must have a `readline' method.  Optional
        second argument is the `filename', which if not given, is
        taken from fp.name.  If fp has no `name' attribute, `<???>' is
        used.

        s   <???>N(   t   Nonet   namet   AttributeErrorRG   (   R   RK   R&   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   readfp6  s    	c         C   s´   |  j  | ƒ } | |  j k re | t k r9 t | ƒ ‚ n  | |  j k rS |  j | St | | ƒ ‚ nK | |  j | k r‡ |  j | | S| |  j k r¡ |  j | St | | ƒ ‚ d  S(   N(   R2   R,   R   R   R-   R   (   R   R    R"   t   opt(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   getF  s    c         C   sˆ   y |  j  | } Wn8 t k
 rK | t k r< t | ƒ ‚ n  |  j ƒ  } n X|  j j ƒ  } | j | ƒ d | k r~ | d =n  | j ƒ  S(   NR   (	   R,   R?   R   R   R+   R-   R>   R@   R1   (   R   R    t   d2t   d(    (    s"   /usr/lib/python2.7/ConfigParser.pyR1   V  s    
c         C   s   | |  j  | | ƒ ƒ S(   N(   RR   (   R   R    t   convR"   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   _getc  s    c         C   s   |  j  | t | ƒ S(   N(   RV   t   int(   R   R    R"   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   getintf  s    c         C   s   |  j  | t | ƒ S(   N(   RV   t   float(   R   R    R"   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   getfloati  s    t   1t   yest   truet   ont   0t   not   falset   offc         C   sH   |  j  | | ƒ } | j ƒ  |  j k r7 t d | ‚ n  |  j | j ƒ  S(   Ns   Not a boolean: %s(   RR   R:   t   _boolean_statesR;   (   R   R    R"   t   v(    (    s"   /usr/lib/python2.7/ConfigParser.pyt
   getbooleano  s    c         C   s
   | j  ƒ  S(   N(   R:   (   R   t	   optionstr(    (    s"   /usr/lib/python2.7/ConfigParser.pyR2   u  s    c         C   su   | s | t  k r/ |  j | ƒ } | |  j k S| |  j k rB t S|  j | ƒ } | |  j | k pp | |  j k Sd S(   s=   Check for the existence of a given option in a given section.N(   R   R2   R-   R,   t   False(   R   R    R"   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt
   has_optionx  s    c         C   sg   | s | t  k r |  j } n1 y |  j | } Wn t k
 rO t | ƒ ‚ n X| | |  j | ƒ <d S(   s   Set an option.N(   R   R-   R,   R?   R   R2   (   R   R    R"   R   t   sectdict(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   set„  s    c         C   s8  |  j  rs | j d t ƒ xF |  j  j ƒ  D]5 \ } } | j d | t | ƒ j d d ƒ f ƒ q* W| j d ƒ n  x¾ |  j D]³ } | j d | ƒ xŒ |  j | j ƒ  D]w \ } } | d k rÆ q¨ n  | d k	 sä |  j |  j	 k rd j
 | t | ƒ j d d ƒ f ƒ } n  | j d | ƒ q¨ W| j d ƒ q} Wd S(	   s?   Write an .ini-format representation of the configuration state.s   [%s]
s   %s = %s
s   
s   
	R   s    = s   %s
N(   R-   t   writeR   R1   t   strt   replaceR,   RM   R/   R0   t   join(   R   RK   R6   R   R    (    (    s"   /usr/lib/python2.7/ConfigParser.pyRk     s    	- *c         C   s   | s | t  k r |  j } n1 y |  j | } Wn t k
 rO t | ƒ ‚ n X|  j | ƒ } | | k } | r{ | | =n  | S(   s   Remove an option.(   R   R-   R,   R?   R   R2   (   R   R    R"   Ri   t   existed(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   remove_option   s    
c         C   s&   | |  j  k } | r" |  j  | =n  | S(   s   Remove a file section.(   R,   (   R   R    Ro   (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   remove_section¯  s    s   \[(?P<header>[^]]+)\]s9   (?P<option>[^:=\s][^:=]*)\s*(?P<vi>[:=])\s*(?P<value>.*)$s>   (?P<option>[^:=\s][^:=]*)\s*(?:(?P<vi>[:=])\s*(?P<value>.*))?$c         C   s:  d } d } d } d } x—t r±| j ƒ  } | s7 Pn  | d } | j ƒ  d k s | d d k ri q n  | j d d ƒ d j ƒ  d k r¡ | d d k r¡ q n  | d j ƒ  rì | d k	 rì | rì | j ƒ  } | r®| | j | ƒ q®q |  j j	 | ƒ }	 |	 rv|	 j
 d ƒ }
 |
 |  j k r2|  j |
 } n; |
 t k rJ|  j } n# |  j ƒ  } |
 | d <| |  j |
 <d } q | d k r—t | | | ƒ ‚ q |  j j	 | ƒ }	 |	 rƒ|	 j
 d	 d
 d ƒ \ } } } |  j | j ƒ  ƒ } | d k	 rv| d k rEd | k rE| j d ƒ } | d k rE| | d j ƒ  rE| |  } qEn  | j ƒ  } | d k rfd } n  | g | | <q®| | | <q | s˜t | ƒ } n  | j | t | ƒ ƒ q W| rÁ| ‚ n  |  j g } | j |  j j ƒ  ƒ xP | D]H } x? | j ƒ  D]1 \ } } t | t ƒ rýd j | ƒ | | <qýqýWqêWd S(   s®  Parse a sectioned setup file.

        The sections in setup file contains a title line at the top,
        indicated by a name in square brackets (`[]'), plus key/value
        options lines, indicated by `name: value' format lines.
        Continuations are represented by an embedded newline then
        leading whitespace.  Blank lines, lines beginning with a '#',
        and just about everything else are ignored.
        i    i   R   s   #;t   remt   rRt   headerR   R"   t   viR   t   =t   :t   ;iÿÿÿÿs   ""s   
N(   Rv   Rw   (   RM   t   Truet   readlinet   stript   splitR:   t   isspaceR(   t   SECTCREt   matcht   groupR,   R   R-   R+   R   R/   R2   t   rstript   findR   t   reprt   extendt   valuesR1   RC   t   listRn   (   R   RK   t   fpnamet   cursectt   optnameR)   t   eR*   R   t   mot   sectnameRu   t   optvalt   post   all_sectionsRB   RN   t   val(    (    s"   /usr/lib/python2.7/ConfigParser.pyRG   Ð  sn    
	
"2"
	 		N(!   R   R   RM   t   _default_dictRg   R   R3   R8   R<   R=   RB   RL   RP   RR   R1   RV   RX   RZ   Ry   Rc   Re   R2   Rh   Rj   Rk   Rp   Rq   t   ret   compileR~   R0   R.   RG   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR   ç   s<   																	
				t	   _Chainmapc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sÕ   Combine multiple mappings for successive lookups.

    For example, to emulate Python's normal lookup sequence:

        import __builtin__
        pylookup = _Chainmap(locals(), globals(), vars(__builtin__))
    c         G   s   | |  _  d  S(   N(   t   _maps(   R   t   maps(    (    s"   /usr/lib/python2.7/ConfigParser.pyR   7  s    c         C   sD   x1 |  j  D]& } y | | SWq
 t k
 r/ q
 Xq
 Wt | ƒ ‚ d  S(   N(   R•   R?   (   R   R6   t   mapping(    (    s"   /usr/lib/python2.7/ConfigParser.pyt   __getitem__:  s    c         C   sa   g  } t  ƒ  } xK |  j D]@ } x7 | D]/ } | | k r& | j | ƒ | j | ƒ q& q& Wq W| S(   N(   Rj   R•   R(   t   add(   R   t   resultt   seenR—   R6   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR7   B  s    	(   R   R   R   R   R˜   R7   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR”   .  s   		c           B   sG   e  Z e d d  „ Z e d d „ Z d „  Z e j d ƒ Z	 d „  Z
 RS(   c   
      C   s
  i  } y |  j  | } Wn, t k
 rE | t k rF t | ƒ ‚ qF n Xi  } | r… x0 | j ƒ  D] \ } } | | |  j | ƒ <q_ Wn  t | | |  j ƒ }	 |  j | ƒ } y |	 | } Wn  t k
 rÙ t | | ƒ ‚ n X| sì | d k rð | S|  j
 | | | |	 ƒ Sd S(   sÃ  Get an option value for a given section.

        If `vars' is provided, it must be a dictionary. The option is looked up
        in `vars' (if provided), `section', and in `defaults' in that order.

        All % interpolations are expanded in the return values, unless the
        optional argument `raw' is true. Values for interpolation keys are
        looked up in the same manner as the option.

        The section DEFAULT is special.
        N(   R,   R?   R   R   R1   R2   R”   R-   R   RM   t   _interpolate(
   R   R    R"   t   rawt   varst   sectiondictt   vardictR6   R   RT   (    (    s"   /usr/lib/python2.7/ConfigParser.pyRR   N  s&    c   	      C   s  |  j  j ƒ  } y | j |  j | ƒ Wn, t k
 rU | t k rV t | ƒ ‚ qV n X| r x0 | j ƒ  D] \ } } | | |  j | ƒ <qi Wn  | j	 ƒ  } d | k r· | j
 d ƒ n  | rÞ g  | D] } | | | f ^ qÄ Sg  | D]( } | |  j | | | | | ƒ f ^ qå Sd S(   sØ  Return a list of tuples with (name, value) for each option
        in the section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        R   N(   R-   R>   R@   R,   R?   R   R   R1   R2   R7   t   removeRœ   (	   R   R    R   Rž   RT   R6   R   RB   R"   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR1   q  s"    c         C   s¼   | } t  } x‚ | r | d 8} | rŒ d | k rŒ |  j j |  j | ƒ } y | | } Wq t k
 rˆ } t | | | | j d ƒ ‚ q Xq Pq W| r¸ d | k r¸ t | | | ƒ ‚ n  | S(   Ni   s   %(i    (   R   t   _KEYCREt   subt   _interpolation_replaceR?   R#   R!   R   (   R   R    R"   R%   Rž   R   t   depthRŠ   (    (    s"   /usr/lib/python2.7/ConfigParser.pyRœ   ‘  s    	
 s   %\(([^)]*)\)s|.c         C   s:   | j  d ƒ } | d  k r% | j  ƒ  Sd |  j | ƒ Sd  S(   Ni   s   %%(%s)s(   R€   RM   R2   (   R   R   t   s(    (    s"   /usr/lib/python2.7/ConfigParser.pyR¤   ¦  s    
N(   R   R   Rg   RM   RR   R1   Rœ   R’   R“   R¢   R¤   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR	   L  s
   # 	c           B   s5   e  Z d  „  Z e j d ƒ Z d „  Z d d „ Z RS(   c         C   s/   g  } |  j  | | | | | d ƒ d j | ƒ S(   Ni   R   (   t   _interpolate_someRn   (   R   R    R"   R%   Rž   t   L(    (    s"   /usr/lib/python2.7/ConfigParser.pyRœ   °  s    s   %\(([^)]+)\)sc         C   sµ  | t  k r! t | | | ƒ ‚ n  x| r°| j d ƒ } | d k  rV | j | ƒ d  S| d k r€ | j | |  ƒ | | } n  | d d !} | d k r³ | j d ƒ | d } q$ | d k r”|  j j | ƒ }	 |	 d  k rö t | | d | ƒ ‚ n  |  j |	 j	 d ƒ ƒ }
 | |	 j
 ƒ  } y | |
 } Wn& t k
 rTt | | | |
 ƒ ‚ n Xd | k r„|  j | | | | | | d ƒ q­| j | ƒ q$ t | | d | f ƒ ‚ q$ Wd  S(   Nt   %i    i   i   t   (s'   bad interpolation variable reference %rs/   '%%' must be followed by '%%' or '(', found: %r(   R   R   R‚   R(   t   _interpvar_reR   RM   R   R2   R€   t   endR?   R#   R§   (   R   R"   t   accumt   restR    t   mapR¥   t   pt   ct   mt   varRd   (    (    s"   /usr/lib/python2.7/ConfigParser.pyR§   ¸  sB    		c         C   s·   |  j  |  j k s | r9 t | t ƒ s9 t d ƒ ‚ q9 n  | d k	 r | j d d ƒ } |  j j d | ƒ } d | k r t	 d | | j
 d ƒ f ƒ ‚ q n  t j |  | | | ƒ d S(   sA   Set an option.  Extend ConfigParser.set: check for string values.s   option values must be stringss   %%R   R©   s1   invalid interpolation syntax in %r at position %dN(   R/   R0   RC   RD   t	   TypeErrorRM   Rm   R«   R£   R;   R‚   R	   Rj   (   R   R    R"   R   t	   tmp_value(    (    s"   /usr/lib/python2.7/ConfigParser.pyRj   Þ  s    N(	   R   R   Rœ   R’   R“   R«   R§   RM   Rj   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyR
   ®  s   		&(   R   t   collectionsR    R‘   t   ImportErrort   dictR’   t   __all__R   R   R   R   R   R   R   R   R#   R   R   R   R   R   t   UserDictt	   _UserDictt	   DictMixinR”   R	   R
   (    (    (    s"   /usr/lib/python2.7/ConfigParser.pyt   <module>X   s:   
		
	ÿ Fb