U e5d')ã @sºdZddddddddd d d d g Zd dlZdZdZdZeeZdZeddZdZ dZ eee eZ ddd„Z d dl Zd dlmZiZGdd„deƒZGdd „d ed�ZGdd „d ƒZdS)anA collection of string constants. Public module variables: whitespace -- a string containing all ASCII whitespace ascii_lowercase -- a string containing all ASCII lowercase letters ascii_uppercase -- a string containing all ASCII uppercase letters ascii_letters -- a string containing all ASCII letters digits -- a string containing all ASCII decimal digits hexdigits -- a string containing all ASCII hexadecimal digits octdigits -- a string containing all ASCII octal digits punctuation -- a string containing all ASCII punctuation characters printable -- a string containing all ASCII characters considered printable Ú ascii_lettersÚascii_lowercaseÚascii_uppercaseÚcapwordsÚdigitsÚ hexdigitsÚ octdigitsÚ printableÚ punctuationÚ whitespaceÚ FormatterÚTemplateéNz ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZÚ 0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pd dd„| |¡Dƒ¡S)a‘capwords(s [,sep]) -> string Split the argument into words using split, capitalize each word using capitalize, and join the capitalized words using join. If the optional second argument sep is absent or None, runs of whitespace characters are replaced by a single space and leading and trailing whitespace are removed, otherwise sep is used to split and join the words. ú css|]}| ¡VqdS©N)Ú capitalize)Ú.0Úx©rú/usr/lib64/python3.8/string.pyÚ 0szcapwords..)ÚjoinÚsplit)ÚsÚseprrrr%s )ÚChainMapcs eZdZdZ‡fdd„Z‡ZS)Ú_TemplateMetaclassa/ %(delim)s(?: (?P%(delim)s) | # Escape sequence of two delimiters (?P%(id)s) | # delimiter and a Python identifier {(?P%(bid)s)} | # delimiter and a braced identifier (?P) # Other ill-formed delimiter exprs ) csbtt|ƒ |||¡d|kr$|j}n$tjt |j¡|j|jp@|jdœ}t  ||j tj B¡|_dS)NÚpattern)ZdelimÚidZbid) ÚsuperrÚ__init__rÚ_reÚescapeÚ delimiterÚ idpatternÚbraceidpatternÚcompileÚflagsÚVERBOSE)ÚclsÚnameÚbasesZdctr©Ú __class__rrr Cs  ýz_TemplateMetaclass.__init__)Ú__name__Ú __module__Ú __qualname__rr Ú __classcell__rrr,rr9s rc@sJeZdZdZdZdZdZejZ dd„Z dd„Z e fd d „Z e fd d „ZdS) r z.A string class for supporting $-substitutions.ú$z(?a:[_a-z][_a-z0-9]*)NcCs ||_dSr)Útemplate)Úselfr3rrrr \szTemplate.__init__cCsd| d¡}|jd|…jdd�}|s.d}d}n"|td |dd…¡ƒ}t|ƒ}td||fƒ‚dS)NÚinvalidT)ÚkeependséÚéÿÿÿÿz.Invalid placeholder in string: line %d, col %d)Ústartr3Ú splitlinesÚlenrÚ ValueError)r4ÚmoÚiÚlinesÚcolnoÚlinenorrrÚ_invalidas ÿzTemplate._invalidc s:ˆtkr|‰n|rt|ˆƒ‰‡‡fdd„}ˆj |ˆj¡S)Ncsd| d¡p| d¡}|dk r(tˆ|ƒS| d¡dk r<ˆjS| d¡dk rTˆ |¡tdˆjƒ‚dS©NÚnamedZbracedZescapedr5z#Unrecognized named group in pattern)ÚgroupÚstrr#rCr=r©r>rE©Úmappingr4rrÚconvertss  ÿz$Template.substitute..convert©Ú_sentinel_dictÚ _ChainMaprÚsubr3©r4rJZkwsrKrrIrÚ substitutems   zTemplate.substitutec s:ˆtkr|‰n|rt|ˆƒ‰‡‡fdd„}ˆj |ˆj¡S)Ncs‚| d¡p| d¡}|dk rHztˆ|ƒWStk rF| ¡YSX| d¡dk r\ˆjS| d¡dk rr| ¡Stdˆjƒ‚dSrD)rFrGÚKeyErrorr#r=rrHrIrrrK†sÿz)Template.safe_substitute..convertrLrPrrIrÚsafe_substitute€s   zTemplate.safe_substitute)r.r/r0Ú__doc__r#r$r%r!Ú IGNORECASEr'r rCrMrQrSrrrrr Ps )Ú metaclassc@sVeZdZdd„Zdd„Zddd„Zdd „Zd d „Zd d „Zdd„Z dd„Z dd„Z dS)r cOs| |||¡Sr)Úvformat)r4Ú format_stringÚargsÚkwargsrrrÚformat¢szFormatter.formatcCs.tƒ}| ||||d¡\}}| |||¡|S)Né)ÚsetÚ_vformatÚcheck_unused_args)r4rXrYrZÚ used_argsÚresultÚ_rrrrW¥szFormatter.vformatr c Csê|dkrtdƒ‚g}| |¡D]¼\}} } } |r8| |¡| dk r| dkrj|dkrXtdƒ‚t|ƒ} |d7}n|  ¡r‚|r~tdƒ‚d}| | ||¡\} } | | ¡| | | ¡} |j| ||||d|d�\} }| |  | | ¡¡qd  |¡|fS)Nr zMax string recursion exceededr8FzJcannot switch from manual field specification to automatic field numberingr7)Úauto_arg_index) r=ÚparseÚappendrGÚisdigitÚ get_fieldÚaddÚ convert_fieldr^Ú format_fieldr)r4rXrYrZr`Zrecursion_depthrcraZ literal_textÚ field_nameÚ format_specÚ conversionÚobjZarg_usedrrrr^«s<ÿ    ý zFormatter._vformatcCst|tƒr||S||SdSr)Ú isinstanceÚint)r4ÚkeyrYrZrrrÚ get_valueás zFormatter.get_valuecCsdSrr)r4r`rYrZrrrr_èszFormatter.check_unused_argscCs t||ƒSr)r[)r4ÚvaluerlrrrrjìszFormatter.format_fieldcCsN|dkr |S|dkrt|ƒS|dkr,t|ƒS|dkrs6þ   Q