Ë hh2O†ò ãó¼—dZddlZddlmZmZmZmZmZmZm Z m Z ddlm Z m Z m Z mZddlZddlmZGd„de«ZGd „d e«ZGd „d e«ZGd „de«Zy)a(Compatibility interfaces for ConfigParser Interfaces of ConfigParser, RawConfigParser and SafeConfigParser should be completely identical to the Python standard library versions. Tested with the unit tests included with Python-2.3.4 The underlying INIConfig object can be accessed as cfg.data éNé)ÚDuplicateSectionErrorÚNoSectionErrorÚ NoOptionErrorÚInterpolationMissingOptionErrorÚInterpolationDepthErrorÚInterpolationSyntaxErrorÚ DEFAULTSECTÚMAX_INTERPOLATION_DEPTH)ÚErrorÚInterpolationErrorÚMissingSectionHeaderErrorÚ ParsingError)Úinic óž—eZdZdefd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z dd „Z dd „Z d „Zd „Zd„ZdddddddddœZd„Zd„Zd„Zd„Zd„Zd„Zy)ÚRawConfigParserNcód—|tk7r td«‚tj||¬«|_y)NzCustom dict types not supported)ÚdefaultsÚoptionxformsource)ÚdictÚ ValueErrorrÚ INIConfigÚdata)ÚselfrÚ dict_types ú4/usr/lib/python3.12/site-packages/iniparse/compat.pyÚ__init__zRawConfigParser.__init__!s(€Ø œÒ ÜÐ>Ó?Ð ?Ü—M‘M¨8ÀtÔLˆ� ócó"—|j«S©N)Úlower)rÚ optionstrs rÚ optionxformzRawConfigParser.optionxform&s€Ø�‰Ó Ð rcó€—i}|jj}|jD]}|j|«||<Œ|Sr )rÚ _defaultsÚ_optionsÚ _compat_get)rÚdÚsecobjÚnames rrzRawConfigParser.defaults)s=€Ø ˆØ—‘×$Ñ$ˆØ—O”OˆDØ×(Ñ(¨Ó.ˆAˆdŠGð$àˆrcó,—t|j«S)z3Return a list of section names, excluding [DEFAULT])Úlistr)rs rÚsectionszRawConfigParser.sections0s€ä�D—I‘I‹Ðrcó´—|j«dk(rtd|z«‚|j|«r t|«‚|jj |«y)zé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 its case-insensitive variants. ÚdefaultzInvalid section name: %sN)r!rÚ has_sectionrrÚ_new_namespace©rÚsections rÚ add_sectionzRawConfigParser.add_section4sN€ð �=‰=‹?˜iÒ 'ÜÐ7¸'ÑAÓBÐ Bà × Ñ ˜GÔ $Ü'¨Ó0Ð 0à �I‰I× $Ñ $ WÕ -rcó—||jvS)z~Indicate whether the named section is present in the configuration. The DEFAULT section is not acknowledged. )rr2s rr0zRawConfigParser.has_sectionEs€ð ˜$Ÿ)™)Ð#Ð#rcód—||jvrt|j|«St|«‚)z9Return a list of option names for the given section name.)rr,rr2s rÚoptionszRawConfigParser.optionsLs-€à �d—i‘iÑ Ü˜Ÿ ™  'Ñ*Ó+Ð +ä  Ó)Ð )rcó—g}t|tj«r|g}|D]J} t|«}|j |«|j j|«|j«ŒL|S#t$rYŒZwxYw)a£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. ) Ú isinstanceÚsixÚ string_typesÚopenÚIOErrorÚappendrÚ_readfpÚclose)rÚ filenamesÚ files_readÚfilenameÚfps rÚreadzRawConfigParser.readSs€ðˆ Ü �i¤×!1Ñ!1Ô 2Ø"˜ ˆIÛ!ˆHð ܘ(“^�ð × Ñ ˜hÔ 'Ø �I‰I× Ñ ˜bÔ !Ø �H‰H�Jð"ðÐøô ò Ùð ús¦ A1Á1 A=Á<A=có:—|jj|«y)aLike 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. N)rr?)rrDrCs rÚreadfpzRawConfigParser.readfpjs€ð � ‰ ×ј"Õrcóš—|j|«s t|«‚|j|}||vr|j|«St ||«‚r )r0rrr'r)rr3ÚoptionÚvarsÚsecs rÚgetzRawConfigParser.gettsL€Ø×Ñ Ô(Ü  Ó)Ð )à�i‰i˜Ñ ˆØ �S‰=Ø—?‘? 6Ó*Ð *ä ¨Ó0Ð 0rcóª—||jvr;g}|j|D]%}|j||j||«f«Œ'|St|«‚r )rr>rLr)rr3ÚansÚopts rÚitemszRawConfigParser.items~sR€Ø �d—i‘iÑ ØˆCØ—y‘y Ô)�Ø— ‘ ˜C §¡¨'°3Ó!7Ð8Õ9ð*àˆJä  Ó)Ð )rcó8—t|j||««Sr )ÚintrL©rr3rIs rÚgetintzRawConfigParser.getint‡s€Ü�4—8‘8˜G VÓ,Ó-Ð-rcó8—t|j||««Sr )ÚfloatrLrSs rÚgetfloatzRawConfigParser.getfloatŠs€Ü�T—X‘X˜g vÓ.Ó/Ð/rTF)Ú1ÚyesÚtrueÚonÚ0ÚnoÚfalseÚoffcó´—|j||«}|j«|jvrtd|z«‚|j|j«S)NzNot a boolean: %s)rLr!Ú_boolean_statesr)rr3rIÚvs rÚ getbooleanzRawConfigParser.getboolean�sN€Ø �H‰H�W˜fÓ %ˆØ �7‰7‹9˜D×0Ñ0Ñ 0ÜÐ0°1Ñ4Ó5Ð 5Ø×#Ñ# A§G¡G£IÑ.Ð.rcóZ—||jvr|j|}||vSt|«‚)z=Check for the existence of a given option in a given section.©rr©rr3rIrKs rÚ has_optionzRawConfigParser.has_option–s5€à �d—i‘iÑ Ø—)‘)˜GÑ$ˆCð˜#� Ðô! Ó)Ð )rcóZ—||jvr||j||<yt|«‚)zSet an option.Nre)rr3rIÚvalues rÚsetzRawConfigParser.setžs,€à �d—i‘iÑ Ø).ˆD�I‰I�gÑ ˜vÒ &ä  Ó)Ð )rcóL—|jt|j««y)z?Write an .ini-format representation of the configuration state.N)ÚwriteÚstrr)rrDs rrlzRawConfigParser.write¥s€à �‰”�T—Y‘Y“Õ rcóf—||jvr|j|}n t|«‚||vr||=yy)zRemove an option.rrrerfs rÚ remove_optionzRawConfigParser.remove_option©s;€à �d—i‘iÑ Ø—)‘)˜GÑ$‰Cä  Ó)Ð )Ø �S‰=Ø�F� ØàrcóB—|j|«sy|j|=y)zRemove a file section.FT)r0rr2s rÚremove_sectionzRawConfigParser.remove_sectionµs"€à×Ñ Ô(ØØ �I‰I�gÐ Ørr )Ú__name__Ú __module__Ú __qualname__rrr#rr-r4r0r7rErGrLrPrTrWrarcrgrjrlrorq©rrrr sƒ„Ø $°óMò !òòò.ò"$ò*òó.ó1ò*ò.ò0ð!¨°tÀ4Ø!¨¸ÀuñN€Oò/ò ò*ò!ò órrcó—eZdZdZd„Zd„Zy)Ú ConfigDictz*Present a dict interface to a ini section.có.—||_||_||_yr )Úcfgr3rJ)rryr3rJs rrzConfigDict.__init__Às€ØˆŒØˆŒ ؈� rcó¬— tj|j|j||j«S#t t f$r t|«‚wxYwr )rrLryr3rJrrÚKeyError)rÚkeys rÚ __getitem__zConfigDict.__getitem__ÅsH€ð Ü"×&Ñ& t§x¡x°·±¸sÀDÇIÁIÓNÐ NøÜœ~Ð.ò ܘ3“-Ð ð ús ‚58¸AN)rrrsrtÚ__doc__rr}rurrrwrw½s„Ù4òó  rrwcó"—eZdZdd„Zd„Zdd„Zy)Ú ConfigParserNcóè—|tk7r|j|«s t|«‚|j|«}tj ||||«}|r|St |||«}|j||||«S)a®Get 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. )r r0rr#rrLrwÚ _interpolate)rr3rIÚrawrJrir(s rrLzConfigParser.getÎsw€ð ”kÒ !¨$×*:Ñ*:¸7Ô*CÜ  Ó)Ð )à×!Ñ! &Ó)ˆÜ×#Ñ# D¨'°6¸4Ó@ˆá ؈Lä˜4 ¨$Ó/ˆAØ×$Ñ$ W¨f°e¸QÓ?Ð ?rcóÜ—|}t}|r|dz}d|vr ||z}nn|rŒ|j d«dk7r t |||«‚|S#t$r }t||||jd«‚d}~wwxYw)Nrz%(réÿÿÿÿ)r r{rÚargsÚfindr)rr3rIÚrawvalrJriÚdepthÚes rr‚zConfigParser._interpolateåsŽ€àˆÜ'ˆÙØ �Q‰JˆEØ�u‰}ð<Ø! D™L‘Eð òð �:‰:�dÓ ˜rÒ !Ü)¨&°'¸6ÓBÐ B؈ øô ò<Ü9Ø ¨°·±¸±ó<ð<ûð<ús•AÁ A+Á A&Á&A+c óì—|tk7r|j|«s t|«‚|€t|j|«}nKg}|j|D]}||vsŒ|j |«Œ|j |j««d|vr|jd«t|||«}|r|D�cgc] }|||f‘Œ c}S|D�cgc]}||j|||||«f‘Œc}Scc}wcc}w)aØ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. rr) r r0rr,rr>ÚextendÚkeysÚremoverwr‚)rr3rƒrJr7Úxr(rIs rrPzConfigParser.items÷s€ð ”kÒ !¨$×*:Ñ*:¸7Ô*CÜ  Ó)Ð )Ø ˆ<ܘ4Ÿ9™9 WÑ-Ó.‰GàˆGØ—Y‘Y˜wÔ'�ؘD’=Ø—N‘N 1Õ%ð(ð �N‰N˜4Ÿ9™9›;Ô 'à ˜Ñ Ø �N‰N˜:Ô &ä �t˜W dÓ +ˆÙ á")ó+Ù")˜ð˜Q˜v™YÒ'Ø")ñ+ð +ñ#*ó+Ù")˜ð˜T×.Ñ.¨w¸ÀÀ&Á È1ÓMÒNØ")ñ+ð +ùò+ùò+s Â4C,à C1)FN)rrrsrtrLr‚rPrurrr€r€Ìs„ó@ò.ô$ +rr€cóž—eZdZejd«Zejd«Zd„Zd„Zejd«jZ d„Z y)ÚSafeConfigParserz %\(([^)]+)\)sz%[^%]|%$có,—t|tj«s td«‚|jj d|«}|j j|«}|rtd||j«fz«‚tj||||«y)Nzoption values must be stringsÚz1invalid interpolation syntax in %r at position %d) r9r:r;Ú TypeErrorÚ _interpvar_reÚsubÚ_badpercent_reÚsearchrÚstartr€rj)rr3rIriÚ tmp_valueÚms rrjzSafeConfigParser.sets�€Ü˜%¤×!1Ñ!1Ô2ÜÐ;Ó<Ð <ð×&Ñ&×*Ñ*¨2¨uÓ5ˆ à × Ñ × &Ñ & yÓ 1ˆÙ Üð+Ø.3°Q·W±W³YÐ-?ñ@óAð Aô ×ј˜w¨°Õ6rcóT—g}|j|||||d«dj|«S)Nrr“)Ú_interpolate_someÚjoin)rr3rIrˆrJÚLs rr‚zSafeConfigParser._interpolate,s-€à ˆØ ×јv q¨&°'¸4ÀÔCØ�w‰w�q‹zÐrc óz—|tkDr t|||«‚|�r|jd«}|dkr|j|«y|dkDr|j|d|«||d}|dd}|dk(r|jd«|dd}n›|dk(r}|j |«} | €t ||d|z«‚| j d«} || j«d} || } d| vr|j||| |||dz«n+|j| «nt ||dt|«z«‚|r�Œyy#t$rt|||| «‚wxYw)NÚ%rréÚ(z'bad interpolation variable reference %rz+'%' must be followed by '%' or '(', found: ) r rr‡r>Ú_interpvar_matchr ÚgroupÚendr{rr�Úrepr) rrIÚaccumÚrestr3Úmapr‰ÚpÚcr›Úvarrbs rr�z"SafeConfigParser._interpolate_some4sm€Ø Ô*Ò *Ü)¨&°'¸4Ó@Ð @ÚØ— ‘ ˜#“ˆAØ�1ŠuØ— ‘ ˜TÔ"ØØ�1ŠuØ— ‘ ˜T " 1˜XÔ&ؘA˜B�x�à�Q�q� ˆAØ�CŠxØ— ‘ ˜SÔ!ؘA˜B�x‘Ø�c’Ø×)Ñ)¨$Ó/�Ø�9Ü2°6¸7ÐDmÐptÑDtÓuÐuØ—g‘g˜a“j�ؘAŸE™E›G˜H�~�ð4ؘC™�Að˜!‘8Ø×*Ñ*¨6°5¸!Ø+2°C¸À¹õDð—L‘L •Oä.ؘGØAÄDÈÃJÑNóPðPõ=øô* ò4Ü9Ø ¨¨só4ð4ð4ús ÃD"Ä"D:N) rrrsrtÚreÚcompiler•r—rjr‚Úmatchr¤r�rurrr‘r‘sM„Ø�B—J‘JÐ/Ó0€MØ�R—Z‘Z  Ó,€Nò 7òð "�r—z‘zÐ"2Ó3×9Ñ9Ðó#Prr‘)r~r®Ú configparserrrrrrr r r r r rrr:r“rÚobjectrrwr€r‘rurrÚr³shðñ ó ÷8÷8ó8÷;ó;ó åôZ�fôZôz  �ô  ôK+�?ôK+ô\=P�|õ=Pr