™N
ÞùO5c       s    d  Z  6 8 k Z 9 k Z : k Z ; k l > d e i d Z ? e i e ƒ Z	 @ d e i d Z
 A e i e
 ƒ Z C d Z H d f  d „  ƒ  YZ N d e f d	 „  ƒ  YZ S d
 e f d „  ƒ  YZ X d e f d „  ƒ  YZ _ d e f d „  ƒ  YZ j d f  d „  ƒ  YZ d S(   sU  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 rfc822.

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 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; it's value
                               is the section's name.

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

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

    read(*filenames) -- read and parse the list of named configuration files

    get(section, option, raw=0) -- 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.

    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 defined as 0
                                    or 1, only)
s   ^\[\([-A-Za-z0-9]*\)\][s   ]*$s   ^\([-A-Za-z0-9.]+\)\(:\|[s   ]*=\)\(.*\)$s   DEFAULTs   Errorc      s    H I d d „ Z  K d „  Z RS(   Nc    s   I J | |  _ d  S(   N(   s   msgs   selfs   _Error__msg(   s   selfs   msgs6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __init__I s   s    c    s   K L |  i Sd  S(   N(   s   selfs   _Error__msg(   s   selfs6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __repr__K s   (   s   __init__s   __repr__(    s6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   ErrorH s   s   NoSectionErrorc      s   N O d „  Z  RS(   Nc    s*   O P t  i |  d | ƒ Q | |  _ d  S(   Ns   No section: %s(   s   Errors   __init__s   selfs   section(   s   selfs   sections6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __init__O s   (   s   __init__(    s6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   NoSectionErrorN s   s   DuplicateSectionErrorc      s   S T d „  Z  RS(   Nc    s*   T U t  i |  d | ƒ V | |  _ d  S(   Ns   Section %s already exists(   s   Errors   __init__s   selfs   section(   s   selfs   sections6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __init__T s   (   s   __init__(    s6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   DuplicateSectionErrorS s   s   NoOptionErrorc      s   X Y d „  Z  RS(   Nc    s<   Y Z t  i |  d | | f ƒ \ | |  _ ] | |  _ d  S(   Ns   No option `%s' in section: %s(   s   Errors   __init__s   selfs   options   section(   s   selfs   options   sections6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __init__Y s   (   s   __init__(    s6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   NoOptionErrorX s   s   InterpolationErrorc      s   _ ` d „  Z  RS(   Nc    sK   ` a t  i |  d | | | f ƒ d | |  _ e | |  _ f | |  _ d  S(   Ns5   Bad value substitution: sect `%s', opt `%s', ref `%s'(   s   Errors   __init__s   selfs   sections   options	   reference(   s   selfs	   references   options   sections6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __init__` s    (   s   __init__(    s6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   InterpolationError_ s   s   ConfigParserc      s§   j k e  d „ Z r d „  Z u d „  Z z d „  Z „ d „  Z ‹ d „  Z “ d „  Z ž d	 d „ Z ¼ d
 „  Z	 ¿ d „  Z
 Â d „  Z Å d „  Z Ì d „  Z RS(   Nc    s?   k l h  |  _ m | t j o n h  |  _ n p | |  _ d  S(   N(   s   selfs   _ConfigParser__sectionss   defaultss   Nones   _ConfigParser__defaults(   s   selfs   defaultss6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __init__k s   c    s   r s |  i Sd  S(   N(   s   selfs   _ConfigParser__defaults(   s   selfs6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   defaultsr s   c    s   u v x |  i i ƒ  Sd S(   s3   Return a list of section names, excluding [DEFAULT]N(   s   selfs   _ConfigParser__sectionss   keys(   s   selfs6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   sectionsu s   c    sC   z  € |  i i | ƒ o  t | ƒ ‚ n ‚ h  |  i | <d S(   s“   Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists.
        N(   s   selfs   _ConfigParser__sectionss   has_keys   sections   DuplicateSectionError(   s   selfs   sections6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   add_sectionz s   c    s   „ ˆ ‰ |  i i | ƒ Sd S(   s~   Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        N(   s   selfs   _ConfigParser__sectionss   has_keys   section(   s   selfs   sections6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   has_section„ s   c    sl   ‹ Œ y  |  i | i ƒ  } Wn% Ž t j
 o  t | ƒ ‚ n X | i |  i ƒ ‘ | i	 ƒ  Sd  S(   N(
   s   selfs   _ConfigParser__sectionss   sections   copys   optss   KeyErrors   NoSectionErrors   updates   _ConfigParser__defaultss   keys(   s   selfs   sections   optss6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   options‹ s   c    s”   “ ” • t  | ƒ t  d ƒ j o – | g } n — xX | d — rK } ˜ y& ™ t | d ƒ } š |  i | ƒ Wn › t j
 o
 œ n Xq> Wd S(   s#   Read and parse a list of filenames.s    i    s   rN(   s   types	   filenamess   files   opens   fps   selfs   _ConfigParser__reads   IOError(   s   selfs	   filenamess   files   fps6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   read“ s    	c    s6  ž ¥ ¦ y § |  i | i ƒ  } WnB ¨ t j
 o3 © | t j o ª h  } n ¬ t | ƒ ‚ n X­ |  i i ƒ  } ® | i
 | ƒ ¯ t i | ƒ } ° y ± | | } Wn( ² t j
 o ³ t | | ƒ ‚ n Xµ | o ¶ | Sn · y ¸ | | SWn- ¹ t j
 o } º t | | | ƒ ‚ n Xd S(   sÖ   Get an option value for a given section.

        All % interpolations are expanded in the return values, based
        on the defaults passed into the constructor.

        The section DEFAULT is special.
        N(   s   selfs   _ConfigParser__sectionss   sections   copys   sectdicts   KeyErrors   DEFAULTSECTs   NoSectionErrors   _ConfigParser__defaultss   ds   updates   strings   lowers   options   rawvals   NoOptionErrors   raws   keys   InterpolationError(   s   selfs   sections   options   raws   sectdicts   ds   rawvals   keys6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   getž s(   
i    c    s    ¼ ½ | |  i | | ƒ ƒ Sd  S(   N(   s   convs   selfs   gets   sections   option(   s   selfs   sections   convs   options6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __get¼ s   c    s    ¿ À |  i | t i | ƒ Sd  S(   N(   s   selfs   _ConfigParser__gets   sections   strings   atois   option(   s   selfs   sections   options6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   getint¿ s   c    s    Â Ã |  i | t i | ƒ Sd  S(   N(   s   selfs   _ConfigParser__gets   sections   strings   atofs   option(   s   selfs   sections   options6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   getfloatÂ s   c    s_   Å Æ |  i | | ƒ } Ç t i | ƒ } È | d d f j o É t d | ‚ n Ê | Sd  S(   Ni    i   s   Not a boolean: %s(	   s   selfs   gets   sections   options   vs   strings   atois   vals
   ValueError(   s   selfs   sections   options   vs   vals6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys
   getbooleanÅ s
   c 	   s‚  Ì Õ Ö t  } × t  } Ø d } Ù xWÙ d oLÚ | i ƒ  } Û | o Ü Pn Ý | d } ß t i | ƒ d j p | d d j o
 à q' n á t i	 t i
 | ƒ d ƒ d j o | d d j o
 ã q' n å | d d j o | t  j o | o9 æ t i | ƒ } ç | o è | | d | } n nDê t i | ƒ d j o‹ ë t i d ƒ } ì |  i i | ƒ o í |  i | } nC î | t j o ï |  i } n# ñ h  | d	 <} ò | |  i | <ô t  } n  ö t i | ƒ d j om ÷ t i d d
 ƒ \ } } ø t i	 | ƒ } ù t i | ƒ } û | d j o ü d } n ý | | | <n  d G| i | | f GHq' 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.
        Continuation are represented by an embedded newline then
        leading whitespace.  Blank lines, lines beginning with a '#',
        and just about everything else is ignored.
        i    i   s    s   #;s   rems   rs    	s   
 s   namei   s   ""s   Error in %s at %d: %sN(   s   Nones   cursects   optnames   linenos   fps   readlines   lines   strings   strips   lowers   splits   values   secthead_cres   matchs   groups   sectnames   selfs   _ConfigParser__sectionss   has_keys   DEFAULTSECTs   _ConfigParser__defaultss
   option_cres   optvals   name(	   s   selfs   fps   cursects   optnames   linenos   lines   values   sectnames   optvals6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   __readÌ sF   				 
*
7
(
(   s   Nones   __init__s   defaultss   sectionss   add_sections   has_sections   optionss   reads   gets   _ConfigParser__gets   getints   getfloats
   getbooleans   _ConfigParser__read(    s6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   ConfigParserj s   
N(   s   __doc__s   syss   strings   regexs   typess   ListTypes
   whitespaces   SECTHEAD_REs   compiles   secthead_cres	   OPTION_REs
   option_cres   DEFAULTSECTs   Errors   NoSectionErrors   DuplicateSectionErrors   NoOptionErrors   InterpolationErrors   ConfigParser(    s6   /var/tmp/python-root/usr/lib/python1.5/ConfigParser.pys   ?6 s   			
	