; =c@sdZdkZdkZdkZdZdfdYZdefdYZdefdYZd efd YZd efd YZ d efdYZ defdYZ dfdYZ dS(sX 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 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 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 has_option(section, option) return whether the given section has the given option 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. 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=0, 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 defined as 0 or 1, only) 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 NsDEFAULTsErrorcBstZddZdZRS(NscCs ||_dS(N(smsgsselfs_msg(sselfsmsg((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__bscCs |iSdS(N(sselfs_msg(sself((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__repr__ds(s__name__s __module__s__init__s__repr__(((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysErroras sNoSectionErrorcBstZdZRS(NcCs!ti|d|||_dS(NsNo section: %s(sErrors__init__sselfssection(sselfssection((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__hs(s__name__s __module__s__init__(((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysNoSectionErrorgssDuplicateSectionErrorcBstZdZRS(NcCs!ti|d|||_dS(NsSection %s already exists(sErrors__init__sselfssection(sselfssection((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__ms(s__name__s __module__s__init__(((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysDuplicateSectionErrorlss NoOptionErrorcBstZdZRS(NcCs0ti|d||f||_||_dS(NsNo option `%s' in section: %s(sErrors__init__sselfsoptionssection(sselfsoptionssection((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__rs (s__name__s __module__s__init__(((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys NoOptionErrorqssInterpolationErrorcBstZdZRS(NcCs?ti|d||||f||_||_||_dS(NsNBad value substitution: section: [%s] option : %s key : %s rawval : %s (sErrors__init__sselfssectionsoptions referencesrawval(sselfs referencesoptionssectionsrawval((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__ys    (s__name__s __module__s__init__(((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysInterpolationErrorxssMissingSectionHeaderErrorcBstZdZRS(NcCs<ti|d|||f||_||_||_dS(Ns7File contains no section headers. file: %s, line: %d %s(sErrors__init__sselfsfilenameslinenosline(sselfsfilenameslinenosline((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__s    (s__name__s __module__s__init__(((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysMissingSectionHeaderErrorss ParsingErrorcBstZdZdZRS(NcCs*ti|d|||_g|_dS(Ns File contains parsing errors: %s(sErrors__init__sselfsfilenameserrors(sselfsfilename((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__s cCs4|ii||f|id||f|_dS(Ns [line %2d]: %s(sselfserrorssappendslinenoslines_msg(sselfslinenosline((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysappends(s__name__s __module__s__init__sappend(((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys ParsingErrors s ConfigParsercBstZedZdZdZdZdZdZdZ dZ ed Z d ed Z d Z d ZdZdZdZdZ dZdZdZdZeidZeidZdZRS(NcCs0h|_|tjo h|_n ||_dS(N(sselfs_ConfigParser__sectionssdefaultssNones_ConfigParser__defaults(sselfsdefaults((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__init__s   cCs |iSdS(N(sselfs_ConfigParser__defaults(sself((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysdefaultsscCs|iiSdS(s3Return a list of section names, excluding [DEFAULT]N(sselfs_ConfigParser__sectionsskeys(sself((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pyssectionsscCs4|ii|ot|nh|i|' is used. sN(sfilenamesNonesfpsnamesAttributeErrorsselfs_ConfigParser__read(sselfsfpsfilename((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysreadfps  ic Cs`y|i|i}Wn6tj o*|tjo h}qPt|nX|ii}|i ||o|i |n|i |}y||} Wn"tj ot||nX|o| Sn| }d}xx|djoj|d}ti|ddjo?y||}WqWtj o} t| ||| qWXq|SqWdS(sGet an option value for a given 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. ii is%(N(sselfs_ConfigParser__sectionsssectionscopyssectdictsKeyErrors DEFAULTSECTsNoSectionErrors_ConfigParser__defaultssdsupdatesvarss optionxformsoptionsrawvals NoOptionErrorsrawsvaluesdepthsstringsfindskeysInterpolationError( sselfssectionsoptionsrawsvarsssectdictsvaluesdsdepthskeysrawval((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysgets:      cCs||i||SdS(N(sconvsselfsgetssectionsoption(sselfssectionsconvsoption((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys__getscCs|i|ti|SdS(N(sselfs_ConfigParser__getssectionsstringsatoisoption(sselfssectionsoption((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysgetintscCs|i|ti|SdS(N(sselfs_ConfigParser__getssectionsstringsatofsoption(sselfssectionsoption((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pysgetfloat!scCsM|i||}ti|}|ddfjotd|n|SdS(NiisNot a boolean: %s( sselfsgetssectionsoptionsvsstringsatoisvals ValueError(sselfssectionsoptionsvalsv((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys getboolean$s cCsti|SdS(N(sstringslowers optionstr(sselfs optionstr((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys optionxform+scCsZ| p |djo|ii|Sn.|i| odSn|i|i|SdS(s=Check for the existence of a given option in a given section.sDEFAULTiN(ssectionsselfs_ConfigParser__defaultsshas_keysoptions has_sections_ConfigParser__sections(sselfssectionsoption((s^/mnt/gmirror/ports/devel/boaconstructor/work/boa-constructor-0.4.4/ExternalLib/ConfigParser.pys has_option.s cCsc| p |djo |i}n4y|i|}Wntj ot|nX|||[-\w_.*,(){}]+)\]s@(?P