Qf . gdZddlZdZdZdZeezZdZedzdzZd Zd Z eeze zezZ dd Z ddl Z dd lmZiZGd dZej'GddZy)) ascii_lettersascii_lowercaseascii_uppercasecapwordsdigits hexdigits octdigits printable punctuation whitespace FormatterTemplateNz abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789abcdefABCDEF01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~c| |xsdjttj|j |S)N )joinmapstr capitalizesplit)sseps -/opt/alt/python312/lib64/python3.12/string.pyrr%s1  J3  S> ??)ChainMapcpeZdZ dZdZdZejZfdZ dZ dZ e fdZ e fdZd Zd ZxZS) r $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__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)r8rorprq used_argsresult_s rrnzFormatter.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_fieldrv format_fieldr)r8rorprqrxrecursion_depthr|ry literal_text field_name format_spec conversionobjarg_useds rrvzFormatter._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)r8keyrprqs r get_valuezFormatter.get_values c3 9 #; rcyr6)r8rxrprqs rrwzFormatter.check_unused_argss rct||Sr6)rr)r8valuers rrzFormatter.format_fieldse[))rc||S|dk(r t|S|dk(r t|S|dk(r t|Stdj |)Nrraz"Unknown conversion specifier {0!s})rreprasciirCrr)r8rrs rrzFormatter.convert_field sZ  L 3 u:  3 ;  3 < =DDZPQQrc,tj|Sr6)_stringformatter_parser)r8ros rr}zFormatter.parses'' 66rctj|\}}|j|||}|D]\}}|r t||}||}||fSr6)rformatter_field_name_splitrgetattr) r8rrprqfirstrestris_attrrEs rrzFormatter.get_field(s[88D tnnUD&1JGQc1o!f  EzrN)r) rgrhrirrrnrvrrwrrr}rrrrr r s69!"3/l * R(7 rr r6)__all__rr rrrrrrr r rrer( collectionsr rWrVr r&r rrrrs  2 ../1  X  (  5 ] "[ 0: = @-rrl yyr