Mini Shell

Direktori : /lib64/python3.9/__pycache__/
Upload File :
Current File : //lib64/python3.9/__pycache__/string.cpython-39.pyc

a

�DOgF)�@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 	

�abcdefghijklmnopqrstuvwxyz�ABCDEFGHIJKLMNOPQRSTUVWXYZ�
0123456789ZabcdefZABCDEF�01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~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.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)�clsr!�delim�id�bid��	__class__rrr#Es 

����zTemplate.__init_subclass__cCs
||_dSr)�template)�selfr3rrr�__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)�startr3�
splitlines�lenr�
ValueError)r4�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�named�braced�escapedr6z#Unrecognized named group in pattern)�group�strr'rDr>r!�r?rF��mappingr4rr�convertns
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr!�subr3�r4rM�kwsrNrrLr�
substitutehs
zTemplate.substitutecs:�tur|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|durFzt�|�WStyD|��YS0|�d�durZ�jS|�d�durp|��Std�j��dSrE)rIrJ�KeyErrorr'r>r!rKrLrrrN�s�z)Template.safe_substitute.<locals>.convertrOrSrrLr�safe_substitute{s

zTemplate.safe_substitute)�__name__�
__module__�__qualname__�__doc__r'r(r)r%�
IGNORECASEr+r#r5rDrPrUrW�
__classcell__rrr1rr9src@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r4�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r4r_r`ra�	used_args�result�_rrrr^�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 exceededr9FzJcannot switch from manual field specification to automatic field numberingr8)�auto_arg_index)r>�parse�appendrJ�isdigit�	get_field�add�
convert_fieldre�format_fieldr)r4r_r`rarg�recursion_depthrjrh�literal_text�
field_name�format_spec�
conversion�obj�arg_usedrrrre�s6�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r4�keyr`rarrr�	get_value�s
zFormatter.get_valuecCsdSrr)r4rgr`rarrrrf�szFormatter.check_unused_argscCs
t||�Sr)rb)r4�valuerurrrrq�szFormatter.format_fieldcCsN|dur|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rJ�repr�asciir>rb)r4r}rvrrrrp�szFormatter.convert_fieldcCs
t�|�Sr)�_string�formatter_parser)r4r_rrrrkszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)r��formatter_field_name_splitr|�getattr)	r4rtr`ra�first�restrw�is_attrr@rrrrns
zFormatter.get_fieldN)r
)rXrYrZrbr^rer|rfrqrprkrnrrrrr�s�
6	r)N)r[�__all__r�r
rrrrrrr	rr�rer%�collectionsrrQrPrr#rrrrr�<module>s$
Y

Zerion Mini Shell 1.0