관리-도구
편집 파일: string.cpython-310.opt-2.pyc
o 6��fF) � @ s� g d �Z ddlZdZdZdZee ZdZed d Zd Zd Z ee e e Z ddd�ZddlZ dd lmZ i ZG dd� d�Ze�� G dd� d�ZdS ))� 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 )N� c s s � | ]}|� � V qd S �N)� capitalize)�.0�x� r �-/opt/alt/python310/lib64/python3.10/string.py� <genexpr>0 s � zcapwords.<locals>.<genexpr>)�join�split)�s�sepr r r r % s r )�ChainMapc sX e Zd Z dZdZdZejZ� fdd�Z dd� Z dd � Zefd d�Z efdd �Z� ZS )r �$z(?a:[_a-z][_a-z0-9]*)Nc sr t � �� d| jv r| j}nt�| j�}| j}| jp| 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 � zTemplate.__init__c C s` |� d�}| jd |� jdd�}|sd}d}n|td�|d d� �� }t|�}td||f ��)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 �: � t u r|� n|rt|� �� � �fdd�}�j�|�j�S )Nc s` | � d�p | � d�}|d urt� | �S | � d�d ur�jS | � d�d ur*��| � td�j���N�namedZbracedZescapedr1 z#Unrecognized named group in pattern)�group�strr# r? r9 r �r: rB ��mappingr. r r �convertn s �z$Template.substitute.<locals>.convert��_sentinel_dict� _ChainMapr �subr- �r. rG ZkwsrH r rF r � substituteh s zTemplate.substitutec r@ )Nc s| | � d�p | � d�}|d ur#zt� | �W S ty" | � � Y S w | � d�d ur-�jS | � d�d ur8| � � S td�j��rA )rC rD �KeyErrorr# r9 r rE rF r r rH � s ��z)Template.safe_substitute.<locals>.convertrI rM r rF r �safe_substitute{ s zTemplate.safe_substitute)�__name__� __module__�__qualname__r# r$ r% r! � IGNORECASEr'