Qf .dZgdZddlZdZdZdZeezZdZedzd zZd Z d Z eeze zezZ dd Z ddl Zdd lmZiZGddZej)GddZy)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 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789abcdefABCDEF01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cz|xsdjttj|j |S)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.  )joinmapstr capitalizesplit)sseps -/opt/alt/python312/lib64/python3.12/string.pyrr%s, J3  S> ??)ChainMapcreZdZdZdZdZdZejZ fdZ dZ dZ e fdZe fd Zd Zd ZxZS) r z.A string class for supporting $-substitutions.$z(?a:[_a-z][_a-z0-9]*)Nc lt|d|jvr |j}nTt j |j }|j}|jxs |j}d|d|d|d|d }t j||jtjz|_y)Npatternz z(?: (?PzC) | # 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)clsr$delimidbid __class__s rr&zTemplate.__init_subclass__Es !#  $kkGJJs}}-EB$$5 C G '"5! Gkk'399s{{+BC rc||_yN)template)selfr7s r__init__zTemplate.__init__Ws   rc|jd}|jd|jd}|sd}d}n+|tdj |ddz }t|}t d||fz)NinvalidT)keependsz.Invalid placeholder in string: line %d, col %d)startr7 splitlineslenr ValueError)r8moilinescolnolinenos r_invalidzTemplate._invalid\s~ HHY  bq!,,d,;EFBGGE#2J/00EZFI %)* *rc tur|n|r t|fd}jj|jS)Nc|jdxs|jd}|t|S|jd jS|jdj|t dj Nnamedbracedescapedr;#Unrecognized named group in pattern)grouprr*rIrCr$rDrMmappingr8s rconvertz$Template.substitute..convertnsHHW%;();E 75>**xx ".~~%xx ". b!B!\\+ +r_sentinel_dict _ChainMapr$subr7r8rSkwsrTs`` r substitutezTemplate.substitutehsA n $G W-G +||77rc tur|n|r t|fd}jj|jS)NcT|jdxs|jd}| t|S|jd jS|jd|jSt dj #t$r|jcYSwxYwrL)rQrKeyErrorr*rCr$rRs rrTz)Template.safe_substitute..convertsHHW%;();E &wu~..xx ".~~%xx ".xxz!B!\\+ +  &88:%&s B B'&B'rUrYs`` rsafe_substitutezTemplate.safe_substitute{sA n $G W-G +||77rc|jj|jD]`}|jdy|jd(|jd:|jdLt d|jy)Nr;FrMrNrOrPT)r$finditerr7rQrC)r8rDs ris_validzTemplate.is_valids|,,'' 6Bxx ".!)HHX&.HHY'/!!FLL""7rcNg}|jj|jD]z}|jdxs|jd}|||vr|j |?|B|jdT|jdft d|j|S)NrMrNr;rOrP)r$rar7rQappendrC)r8idsrDrMs rget_identifierszTemplate.get_identifierss,,'' 6BHHW%;();E U#%5 5!-HHY'/HHY'/!!FLL""7 r)__name__ __module__ __qualname____doc__r*r+r,r( IGNORECASEr.r&r9rIrVr[r_rbrf __classcell__)r4s@rr r 9sN8I )IN NNED$! *"08&'58* rr cFeZdZdZdZ d dZdZdZdZdZ dZ d Z y ) r c(|j|||Sr6)vformat)r8 format_stringargskwargss rformatzFormatter.formats||M488rcpt}|j||||d\}}|j||||S)N)set_vformatcheck_unused_args)r8rprqrr used_argsresult_s rrozFormatter.vformats:E MM-vy!L  y$7 rc $|dkr tdg}|j|D]\}} } } |r|j|| | dk(r |dur tdt|} |dz }n| j r|r tdd}|j | ||\} } |j | |j| | } |j| ||||dz |\} }|j|j| | dj||fS)NrzMax string recursion exceededr>FzJcannot switch from manual field specification to automatic field numberingr=)auto_arg_index) rCparserdrisdigit get_fieldadd convert_fieldrw format_fieldr)r8rprqrrryrecursion_depthr}rz literal_text field_name format_spec conversionobjarg_useds rrwzFormatter._vformatsL Q <= = =) >L*k: l+% #%.(*566"%^!4J"a'N'')%(*566 &+N!%z4 H X h'((j9/3mmvq0#1/</3+ ^  d//[ABW*Zwwv..rc6t|tr||S||Sr6) isinstanceint)r8keyrqrrs r get_valuezFormatter.get_values c3 9 #; rcyr6)r8ryrqrrs rrxzFormatter.check_unused_argss rct||Sr6)rs)r8valuers rrzFormatter.format_fieldse[))rc||S|dk(r t|S|dk(r t|S|dk(r t|Stdj |)Nrraz"Unknown conversion specifier {0!s})rreprasciirCrs)r8rrs rrzFormatter.convert_field sZ  L 3 u:  3 ;  3 < =DDZPQQrc,tj|Sr6)_stringformatter_parser)r8rps rr~zFormatter.parses'' 66rctj|\}}|j|||}|D]\}}|r t||}||}||fSr6)rformatter_field_name_splitrgetattr) r8rrqrrfirstrestris_attrrEs rrzFormatter.get_field(s[88D tnnUD&1JGQc1o!f  EzrN)r) rgrhrirsrorwrrxrrr~rrrrr r s69!"3/l * R(7 rr r6)rj__all__rr rrrrrrr r rrer( collectionsr rWrVr r&r rrrrs  2 ../1  X  (  5 ] "[ 0: = @-rrl yyr