Hacked By AnonymousFox

Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/string.cpython-39.pyc

a

���eF)�@s�dZgd�ZddlZdZdZdZeeZdZedd	Zd
Z	dZ
eee
eZddd
�Zddl
ZddlmZiZGdd�d�Ze��Gdd�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�+/opt/alt/python39/lib64/python3.9/string.py�	<genexpr>0�zcapwords.<locals>.<genexpr>)�join�split)�s�seprrrr%sr)�ChainMapcsZeZdZdZdZdZdZejZ	�fdd�Z
dd�Zd	d
�Ze
fdd�Ze
fd
d�Z�ZS)rz.A string class for supporting $-substitutions.�$z(?a:[_a-z][_a-z0-9]*)Nc	srt���d|jvr|j}n<t�|j�}|j}|jp8|j}d|�d|�d|�d|�d�	}t�	||j
tjB�|_dS)N�patternz
            z(?:
              (?P<escaped>zC)  |   # Escape sequence of two delimiters
              (?P<named>zJ)       |   # delimiter and a Python identifier
              {(?P<braced>z�)} |   # delimiter and a braced identifier
              (?P<invalid>)             # Other ill-formed delimiter exprs
            )
            )�super�__init_subclass__�__dict__r�_re�escape�	delimiter�	idpattern�braceidpattern�compile�flags�VERBOSE)�clsrZdelim�idZbid��	__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||f��dS)N�invalidT)�keepends�����z.Invalid placeholder in string: line %d, col %d)�startr.�
splitlines�lenr�
ValueError)r/�mo�i�lines�colno�linenorrr�_invalid\s
�zTemplate._invalidcs:�tur|�n|rt|�����fdd�}�j�|�j�S)Ncsd|�d�p|�d�}|dur(t�|�S|�d�dur<�jS|�d�durT��|�td�j��dS�N�namedZbracedZescapedr1z#Unrecognized named group in pattern)�group�strr$r?r9r�r:rA��mappingr/rr�convertns
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr�subr.�r/rFZkwsrGrrEr�
substitutehs
zTemplate.substitutecs:�tur|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|durFzt�|�WStyD|��YS0|�d�durZ�jS|�d�durp|��Std�j��dSr@)rBrC�KeyErrorr$r9rrDrErrrG�s�z)Template.safe_substitute.<locals>.convertrHrLrrEr�safe_substitute{s

zTemplate.safe_substitute)�__name__�
__module__�__qualname__�__doc__r$r%r&r"�
IGNORECASEr(r r0r?rIrMrO�
__classcell__rrr,rr9src@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r/�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r/rWrXrY�	used_args�result�_rrrrV�szFormatter.vformatr
c	Cs�|dkrtd��g}|�|�D]�\}}	}
}|r8|�|�|	dur|	dkrj|durXtd��t|�}	|d7}n|	��r�|r~td��d}|�|	||�\}}
|�|
�|�||�}|j|
||||d|d�\}
}|�|�	||
��qd�
|�|fS)Nr
zMax string recursion exceededr4FzJcannot switch from manual field specification to automatic field numberingr3)�auto_arg_index)r9�parse�appendrC�isdigit�	get_field�add�
convert_fieldr]�format_fieldr)r/rWrXrYr_Zrecursion_depthrbr`Zliteral_text�
field_name�format_spec�
conversion�objZarg_usedrrrr]�s6�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r/�keyrXrYrrr�	get_value�s
zFormatter.get_valuecCsdSrr)r/r_rXrYrrrr^�szFormatter.check_unused_argscCs
t||�Sr)rZ)r/�valuerkrrrri�szFormatter.format_fieldcCsN|dur|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rC�repr�asciir9rZ)r/rrrlrrrrh�szFormatter.convert_fieldcCs
t�|�Sr)�_stringZformatter_parser)r/rWrrrrcszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)rwZformatter_field_name_splitrq�getattr)	r/rjrXrY�first�restrmZis_attrr;rrrrfs
zFormatter.get_fieldN)r
)rPrQrRrZrVr]rqr^rirhrcrfrrrrr�s�
6	r)N)rS�__all__rwr
rrrrrrr	rr�rer"�collectionsrrJrIrr rrrrr�<module>s$
Y

Hacked By AnonymousFox1.0, Coded By AnonymousFox