AlkantarClanX12
Current Path : /opt/alt/python39/lib64/python3.9/__pycache__/ |
Current File : //opt/alt/python39/lib64/python3.9/__pycache__/string.cpython-39.pyc |
a R�fF) � @ s� d Z g d�ZddlZdZdZdZee ZdZed d Zd Z dZ ee e e Zddd �Zddl ZddlmZ i ZG dd� d�Ze�� G dd� d�ZdS )an A 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 !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~c C s |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. � c s s | ]}|� � V qd S �N)� capitalize)�.0�x� r �+/opt/alt/python39/lib64/python3.9/string.py� <genexpr>0 � zcapwords.<locals>.<genexpr>)�join�split)�s�sepr r r r % s r )�ChainMapc sZ e Zd ZdZdZdZdZejZ � fdd�Z dd� Zd d � Ze fdd�Ze fd d�Z� ZS )r z.A string class for supporting $-substitutions.�$z(?a:[_a-z][_a-z0-9]*)Nc sr t � �� d| jv r| j}n<t�| j�}| j}| jp8| j}d|� d|� d|� d|� d� }t� || j tjB �| _d S )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 Zdelim�idZbid�� __class__r r r E s ����zTemplate.__init_subclass__c C s || _ d S r )�template)�selfr. r r r �__init__W s zTemplate.__init__c C sd |� d�}| jd |� jdd�}|s.d}d}n"|td�|d d� �� }t|�}td||f ��d S )N�invalidT)�keepends� � ���z.Invalid placeholder in string: line %d, col %d)�startr. � splitlines�lenr � ValueError)r/ �mo�i�lines�colno�linenor r r �_invalid\ s �zTemplate._invalidc s: � t u r|� n|rt|� �� � �fdd�}�j�|�j�S )Nc sd | � d�p| � d�}|d ur(t� | �S | � d�d ur<�jS | � d�d urT��| � td�j��d S �N�namedZbracedZescapedr1 z#Unrecognized named group in pattern)�group�strr$ r? r9 r �r: rA ��mappingr/ r r �convertn s �z$Template.substitute.<locals>.convert��_sentinel_dict� _ChainMapr �subr. �r/ rF ZkwsrG r rE r � substituteh s zTemplate.substitutec s: � t u r|� n|rt|� �� � �fdd�}�j�|�j�S )Nc s� | � d�p| � d�}|d urFzt� | �W S tyD | � � Y S 0 | � d�d urZ�jS | � d�d urp| � � S td�j��d S r@ )rB rC �KeyErrorr$ r9 r rD rE r r rG � s �z)Template.safe_substitute.<locals>.convertrH rL r rE r �safe_substitute{ s zTemplate.safe_substitute)�__name__� __module__�__qualname__�__doc__r$ r% r&