a DOgF)@sdZgdZddlZdZdZdZeeZdZedd Zd Z d Z eee eZ dd d Z ddl ZddlmZiZGdddZeGdddZdS)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_lettersascii_lowercaseascii_uppercasecapwordsdigits hexdigits octdigits printable punctuation whitespace FormatterTemplateNz ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pddd||DS)acapwords(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|]}|VqdSN) capitalize).0xr+/opt/alt/python39/lib64/python3.9/string.py 0zcapwords..)joinsplit)sseprrrr%s r)ChainMapcsZeZdZdZdZdZdZejZ fddZ ddZ d d Z e fd d Ze fd dZZS)r z.A string class for supporting $-substitutions.$z(?a:[_a-z][_a-z0-9]*)Nc srtd|jvr|j}nzC) | # Escape sequence of two delimiters (?PzJ) | # delimiter and a Python identifier {(?Pz)} | # delimiter and a braced identifier (?P) # Other ill-formed delimiter exprs ) ) super__init_subclass____dict__r_reescape delimiter idpatternbraceidpatterncompileflagsVERBOSE)clsrZdelimidZbid __class__rrr Es     zTemplate.__init_subclass__cCs ||_dSr)template)selfr.rrr__init__WszTemplate.__init__cCsd|d}|jd|jdd}|s.d}d}n"|td|dd}t|}td||fdS)NinvalidT)keependsz.Invalid placeholder in string: line %d, col %d)startr. splitlineslenr ValueError)r/moilinescolnolinenorrr_invalid\s zTemplate._invalidc s:tur|n|rt|fdd}j|jS)Ncsd|dp|d}|dur(t|S|ddur<jS|ddurT|tdjdSNnamedZbracedZescapedr1z#Unrecognized named group in pattern)groupstrr$r?r9rr:rAmappingr/rrconvertns  z$Template.substitute..convert_sentinel_dict _ChainMaprsubr.r/rFZkwsrGrrEr substitutehs   zTemplate.substitutec s:tur|n|rt|fdd}j|jS)Ncs|dp|d}|durFzt|WStyD|YS0|ddurZjS|ddurp|StdjdSr@)rBrCKeyErrorr$r9rrDrErrrGs z)Template.safe_substitute..convertrHrLrrErsafe_substitute{s   zTemplate.safe_substitute)__name__ __module__ __qualname____doc__r$r%r&r" IGNORECASEr(r r0r?rIrMrO __classcell__rrr,rr 9s  r c@sVeZdZddZddZdddZdd Zd d Zd d ZddZ ddZ ddZ dS)r cOs||||Sr)vformat)r/ format_stringargskwargsrrrformatszFormatter.formatcCs.t}|||||d\}}|||||S)N)set_vformatcheck_unused_args)r/rWrXrY used_argsresult_rrrrVszFormatter.vformatr c Cs|dkrtdg}||D]\}} } } |r8||| dur| dkrj|durXtdt|} |d7}n| r|r~tdd}|| ||\} } || || | } |j| ||||d|d\} }|| | | qd ||fS)Nr zMax string recursion exceededr4FzJcannot switch from manual field specification to automatic field numberingr3)auto_arg_index) r9parseappendrCisdigit get_fieldadd convert_fieldr] format_fieldr)r/rWrXrYr_Zrecursion_depthrbr`Z literal_text field_name format_spec conversionobjZarg_usedrrrr]s6     zFormatter._vformatcCst|tr||S||SdSr) isinstanceint)r/keyrXrYrrr get_values zFormatter.get_valuecCsdSrr)r/r_rXrYrrrr^szFormatter.check_unused_argscCs t||Sr)rZ)r/valuerkrrrriszFormatter.format_fieldcCsN|dur |S|dkrt|S|dkr,t|S|dkrs$   Y