e nSrSSKJrJr SSKJr SSKrSSKrSSK r SSK r SSK r SSK r SSK r SSKrSr\rSrSr"SS \5r"S S \5r"S S \5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r "S S!5r!\!"5r"\#"5r$"S"S#5r%"S$S%\%5r&"S&S'\%5r'"S(S)5r("S*S+\)5r*"S,S-\5r+"S.S/\+5r,"S0S1\5r-"S2S3\5r.g)4aaConfiguration file parser. A configuration 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. 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, dict_type=_default_dict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section='DEFAULT', interpolation=, converters=, allow_unnamed_section=False): Create the parser. When `defaults` is given, it is initialized into the dictionary or intrinsic defaults. The keys must be strings, the values must be appropriate for %()s string interpolation. When `dict_type` is given, it will be used to create the dictionary objects for the list of sections, for the options within a section, and for the default values. When `delimiters` is given, it will be used as the set of substrings that divide keys from values. When `comment_prefixes` is given, it will be used as the set of substrings that prefix comments in empty lines. Comments can be indented. When `inline_comment_prefixes` is given, it will be used as the set of substrings that prefix comments in non-empty lines. When `strict` is True, the parser won't allow for any section or option duplicates while reading from a single source (file, string or dictionary). Default is True. When `empty_lines_in_values` is False (default: True), each empty line marks the end of an option. Otherwise, internal empty lines of a multiline option are kept as part of the value. When `allow_no_value` is True (default: False), options without values are accepted; the value presented for these is None. When `default_section` is given, the name of the special section is named accordingly. By default it is called ``"DEFAULT"`` but this can be customized to point to any other valid section name. Its current value can be retrieved using the ``parser_instance.default_section`` attribute and may be modified at runtime. When `interpolation` is given, it should be an Interpolation subclass instance. It will be used as the handler for option value pre-processing when using getters. RawConfigParser objects don't do any sort of interpolation, whereas ConfigParser uses an instance of BasicInterpolation. The library also provides a ``zc.buildout`` inspired ExtendedInterpolation implementation. When `converters` is given, it should be a dictionary where each key represents the name of a type converter and each value is a callable implementing the conversion from string to the desired datatype. Every converter gets its corresponding get*() method on the parser object and section proxies. When `allow_unnamed_section` is True (default: False), options without section are accepted: the section for these is ``configparser.UNNAMED_SECTION``. 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, encoding=None) Read and parse the iterable of named configuration files, given by name. A single filename is also allowed. Non-existing files are ignored. Return list of successfully read files. read_file(f, filename=None) Read and parse one configuration file, given as a file object. The filename defaults to f.name; it is only used in error messages (if f has no `name` attribute, the string `` is used). read_string(string) Read configuration from a given string. read_dict(dictionary) Read configuration from a dictionary. Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in order. Values are automatically converted to strings. get(section, option, raw=False, vars=None, fallback=_UNSET) 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. If `option` is a key in `vars`, the value from `vars` is used. getint(section, options, raw=False, vars=None, fallback=_UNSET) Like get(), but convert value to an integer. getfloat(section, options, raw=False, vars=None, fallback=_UNSET) Like get(), but convert value to a float. getboolean(section, options, raw=False, vars=None, fallback=_UNSET) 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=_UNSET, raw=False, vars=None) If section is given, return a list of tuples with (name, value) for each option in the section. Otherwise, return a list of tuples with (section_name, section_proxy) for each section, including DEFAULTSECT. 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, space_around_delimiters=True) Write the configuration state in .ini format. If `space_around_delimiters` is True (the default), delimiters between keys and values are surrounded by spaces. )IterableMutableMapping)ChainMapN)NoSectionErrorDuplicateOptionErrorDuplicateSectionError NoOptionErrorInterpolationErrorInterpolationDepthErrorInterpolationMissingOptionErrorInterpolationSyntaxError ParsingErrorMissingSectionHeaderErrorMultilineContinuationError ConfigParserRawConfigParser InterpolationBasicInterpolationExtendedInterpolation SectionProxyConverterMapping DEFAULTSECTMAX_INTERPOLATION_DEPTHUNNAMED_SECTIONDEFAULT c,\rSrSrSrSSjrSr\rSrg)Errorz'Base class for ConfigParser exceptions.c:Xl[RX5 gN)message Exception__init__)selfmsgs 2/opt/imh/python3.13/lib/python3.13/configparser.pyr$Error.__init__s 4%cUR$r!r"r%s r'__repr__Error.__repr__s ||r)r+N)) __name__ __module__ __qualname____firstlineno____doc__r$r-__str____static_attributes__r)r'rrs1&Gr)rc\rSrSrSrSrSrg)rz2Raised when no section matches a requested option.cT[RUSU<35 XlU4Ulg)Nz No section: )rr$sectionargsr%r;s r'r$NoSectionError.__init__s! t:; K r))r<r;Nr0r1r2r3r4r$r6r7r)r'rrs < r)rc"\rSrSrSrSSjrSrg)rzRaised when a section is repeated in an input source. Possible repetitions that raise this exception are: multiple creation using the API or in strict parsers when a section is found more than once in a single input file, string or dictionary. Ncr[U5S/nUbUS[U5/nUb URSRU55 URS5 URU5 UnOUR SS5 [ R USRU55 XlX l X0l XU4Ul g)N already existsWhile reading from  [line {0:2d}]z : section rzSection r/) reprappendformatextendinsertrr$joinr;sourcelinenor<)r%r;rLrMr&r"s r'r$DuplicateSectionError.__init__sG}/0  ,d6l;G!/66v>? NN< ( NN3 C JJq* % tRWWS\*   f- r))r<rMr;rLNNr?r7r)r'rrs .r)rc"\rSrSrSrSSjrSrg)rzRaised by strict parsers when an option is repeated in an input source. Current implementation raises this exception only when an option is found more than once in a single file, string or dictionary. Nc[U5S[U5S/nUbUS[U5/nUb URSRU55 URS5 URU5 UnOUR SS5 [ R USRU55 XlX l X0l X@l XX44Ul g) Nz in section rCrDrEz : option rzOption r/) rFrGrHrIrJrr$rKr;optionrLrMr<)r%r;rSrLrMr&r"s r'r$DuplicateOptionError.__init__sF|^T'] "  ,d6l;G!/66v>? NN; ' NN3 C JJq) $ tRWWS\*    f5 r))r<rMrSr;rLrOr?r7r)r'rrs  6r)rc\rSrSrSrSrSrg)r z!A requested option was not found.ch[RUSU<SU<35 XlX lX4Ulg)Nz No option z in section: rr$rSr;r<)r%rSr;s r'r$NoOptionError.__init__s. t) *  % r)r<rSr;Nr?r7r)r'r r s +&r)r c\rSrSrSrSrSrg)r iz0Base class for interpolation-related exceptions.cX[RX5 XlX lXU4Ulgr!rX)r%rSr;r&s r'r$InterpolationError.__init__ s$ t!  c* r)rZNr?r7r)r'r r s :+r)r c\rSrSrSrSrSrg)r izAA string substitution required a setting which was not available.crSRXXC5n[RXX%5 X@lXX44Ulg)NzBad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})rHr r$ referencer<)r%rSr;rawvalr`r&s r'r$(InterpolationMissingOptionError.__init__s;!!'!K  ##D'?"f8 r))r<r`Nr?r7r)r'r r s K9r)r c\rSrSrSrSrg)r izRaised when the source text contains invalid syntax. Current implementation raises this exception when the source text into which substitutions are made does not conform to the required syntax. r7N)r0r1r2r3r4r6r7r)r'r r sr)r c\rSrSrSrSrSrg)r i%z0Raised when substitutions are nested too deeply.cpSRX[U5n[RXX$5 XU4Ulg)NzRecursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})rHrr r$r<)r%rSr;rar&s r'r$ InterpolationDepthError.__init__(s>&*A! ##D'?f- r))r<Nr?r7r)r'r r %s :.r)r cV^\rSrSrSrU4SjrSrSr\S\ S4Sj5r Sr U=r $) ri2z>Raised when a configuration file does not follow legal syntax.c>[TU]SU<35 Xl/UlU4UlU(aUR "U6 gg)Nz Source contains parsing errors: )superr$rLerrorsr<rG)r%rLr< __class__s r'r$ParsingError.__init__5sA ;F:FG  J  KK  r)cURRX45 U=RSU[U54-- slg)Nz [line %2d]: %s)rjrGr"rF)r%rMlines r'rGParsingError.append=s3 F>* ,T /CCC r)c\UH%nURHnUR"U6 M M' U$r!)rjrG)r%othersothererrors r'combineParsingError.combineAs-E U#& r) exceptionsc[U5n[R"[5 [ U5R U5e!,(df  g=f)z< Combine any number of ParsingErrors into one and raise it. N)iter contextlibsuppress StopIterationnextrt)rvs r' _raise_allParsingError._raise_allGs; *%   /z"**:6 60 /s A A)r<rjrL) r0r1r2r3r4r$rGrt staticmethodrr}r6 __classcell__rks@r'rr2s6HD 7x777r)rc\rSrSrSrSrSrg)riRz@Raised when a key-value pair is found before any section header.cp[RUSXU4-5 XlX lX0lXU4Ulg)Nz7File contains no section headers. file: %r, line: %d %rrr$rLrMrnr<r%filenamerMrns r'r$"MissingSectionHeaderError.__init__Us>   G t $ % &   t, r)r<rnrMrLNr?r7r)r'rrRs J-r)rc\rSrSrSrSrSrg)ri`z@Raised when a key without value is followed by continuation linecp[RUSXU4-5 XlX lX0lXU4Ulg)NzHKey without value continued with an indented line. file: %r, line: %d %rrrs r'r$#MultilineContinuationError.__init__bs@   % % & '    t, r)rNr?r7r)r'rr`s J -r)rc\rSrSrSrSrg)_UnnamedSectionimcg)Nzr7r,s r'r-_UnnamedSection.__repr__os"r)r7N)r0r1r2r3r-r6r7r)r'rrms#r)rc0\rSrSrSrSrSrSrSrSr g) ri|zBDummy interpolation that passes the value through with no changes.cU$r!r7)r%parserr;rSvaluedefaultss r' before_getInterpolation.before_get r)cU$r!r7r%rr;rSrs r' before_setInterpolation.before_setrr)cU$r!r7rs r' before_readInterpolation.before_readrr)cU$r!r7rs r' before_writeInterpolation.before_writerr)r7N) r0r1r2r3r4rrrrr6r7r)r'rr|sLr)rcN\rSrSrSr\R "S5rSrSr Sr Sr g) riaInterpolation as implemented in the classic ConfigParser. The option values can contain format strings which refer to other values in the same section, or values in the 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. If a user needs to use a bare % in a configuration file, she can escape it by writing %%. Other % usage is considered a user error and raises `InterpolationSyntaxError`.z %\(([^)]+)\)sc P/nURXXdX%S5 SRU5$Nr/_interpolate_somerKr%rr;rSrrLs r'rBasicInterpolation.before_get)  vqANwwqzr)cURSS5nURRSU5nSU;a[SXER S54-5eU$)Nz%%r/%1invalid interpolation syntax in %r at position %dreplace_KEYCREsub ValueErrorfindr%rr;rSr tmp_values r'rBasicInterpolation.before_set^MM$+ LL$$R3 ) +.3^^C5H-IJK K r)c URXRSUS9nU[:a [X%U5eU(GaURS5n U S:aUR U5 gU S:aUR USU 5 XISnUSSn U S:XaUR S5 USSnOU S:XaUR R U5n U c[X%SU-5eURU RS55n XKR5SnXln SU ;aURXX=XVUS-5 O"UR U 5 O[X%S U<35eU(aGMgg![a [X%X5Sef=f) NTrawfallbackrrr('bad interpolation variable reference %rz+'%' must be followed by '%' or '(', found: )getrr rrGrmatchr optionxformgroupendKeyErrorr r)r%rrSaccumrestr;mapdepthrapcmvarvs r'r$BasicInterpolation._interpolate_somesGE * *)&6B B #A1u T"1u T"1X&BxQq ACx S!ABxcLL&&t,926ADHJJ((4EEGH~@A!8**65+2DLLO.G#'*++?d, @96;?@@s ?EE'r7N r0r1r2r3r4recompilerrrrr6r7r)r'rrs( Ijj)*G '+r)rcN\rSrSrSr\R "S5rSrSr Sr Sr g) rizuAdvanced variant of interpolation, supports the syntax used by `zc.buildout`. Enables interpolation between sections.z \$\{([^}]+)\}c P/nURXXdX%S5 SRU5$rrrs r'r ExtendedInterpolation.before_getrr)cURSS5nURRSU5nSU;a[SXER S54-5eU$)Nz$$r/$rrrs r'r ExtendedInterpolation.before_setrr)c URXRSUS9nU[:a [X%U5eU(GaURS5n U S:aUR U5 gU S:aUR USU 5 XISnUSSn U S:XaUR S5 USSnGO4U S:XGaUR R U5n U c[X%SU-5eU RS5RS 5n XKR5SnUn Un[U 5S:XaURU S5nXnnOI[U 5S:Xa*U Sn URU S5nURXSS 9nO[X%S U<35eSU;a0UR%XX?U ['UR)U SS 95US-5 O"UR U5 O[X%S U<35eU(aGMgg![[[4a [!X%US R#U 55Sef=f) NTrrrrr{r:)rzMore than one ':' found: z+'$' must be followed by '$' or '{', found: )rrr rrGrrr rsplitrlenrrrr r rKrdictitems)r%rrSrrr;rrrarrrpathsectoptrs r'r'ExtendedInterpolation._interpolate_somes+GE * *)&6B B #A1u T"1u T"1X&BxQq ACx S!ABxcLL&&t,926ADHJJwwqz'',EEGH~K4yA~$00a9HTa#Aw$00a9"JJtdJ;6"G=ACEE !8**6$+/ Tt 0L+M+0196LLO.G#'*++YdD!.-@K9$AFJKKs'G-8G&G3H r7Nrr7r)r'rrs'>jj)*G 4+r)rc\rSrSr%\\\S'Sr\\\4S-\S'Sr \S-\S'Sr \S-\S'Sr \ \S'Sr \ \S '\\\S 'S rS rg) _ReadStateielements_addedNcursectsectnameoptnamerrM indent_levelrjc@[5Ul[5Ulgr!)setrlistrjr,s r'r$_ReadState.__init__'s!ef r))rrj)r0r1r2r3rstr__annotations__rrrrrMintrrrr$r6r7r)r'rrscX&*Gd38nt#* HsTz GcDjFSL3 , r)rcn^\rSrSrU4SjrSr\RS5r\ S5r Sr Sr Sr U=r$) _Linei,c">[TU]X5$r!)ri__new__)clsvalr<kwargsrks r'r _Line.__new__.sws((r)cX lgr!prefixes)r%rrs r'r$_Line.__init__1s r)cPUR5=(a UR5$r!) _strip_full _strip_inliner,s r'clean _Line.clean4s!:d&8&8&::r)c<UR5UR:g$r!)striprr,s r' has_comments_Line.has_comments8szz|tzz))r)c([R"SRSURR55=(d S5nUR U5nUSU(aUR 5R5$SR5$)zS Search for the earliest prefix at the beginning of the line or following a space. |c3V# UHnS[R"U5S3v M! g7f)z(^|\s)()Nrescape).0prefixs r' &_Line._strip_inline..As%XCW & 12!4CWs')z(?!)N)rrrKrinlinesearchstartr)r%matcherrs r'r_Line._strip_inline<sv** HHX4==CWCWX X   t$5eU[[]6<<>>6<<>>r)c[[UR5RURR 55(aS$S$)Nr/T)anyrr startswithrfullr,s r'r_Line._strip_fullHs5TZZ\44dmm6H6HIJJrTPTTr)r)r0r1r2r3rr$ functoolscached_propertyrpropertyrrrr6rrs@r'rr,sL)!;;** ?UUr)rc ^\rSrSrSrSrSrSr\"5r \ R"\\ R5r \ R"\RSS9\ R5r\ R"\RSS9\ R5r\ R"S5rS S S S S S S S S .rS \S 4S SS S S \\\S S. SjjrSrSrSrSrSrS?SjrS?SjrS@SjrSASjrS S \S.Sjr Sr!S S \S.Sjr"S S \S.Sjr#S S \S.Sjr$S S \S.S jr%\S S 4U4S!jjr&S"r'S#r(S$r)S?S%jr*SBS&jr+SCS'jr,S(r-S)r.S*r/S+r0S,r1S-r2S.r3S/r4S0r5S1r6S2r7S3r8S4r9S5r:S6r;S7rS:S:S:S;.S<jr?\@S=5rAS>rBU=rC$)DriLz,ConfigParser that does not do interpolation.z \[ # [ (?P
.+) # very permissive! \] # ] a (?P