Edit File: string.cpython-36.pyc
3 � \.������������������@���s����d�Z�ddddddddd d ddgZd dlZdZdZdZee�ZdZed�d�ZdZ dZ ee�e �e�Zddd�Zd dl Zd dlmZ�G�dd��de�ZG�dd��ded�ZG�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���|pdj�dd��|�j|�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���|�]}|j���V��qd�S�)N)� capitalize)�.0�x��r����/usr/lib64/python3.6/string.py� <genexpr>0���s����zcapwords.<locals>.<genexpr>)�join�split)�s�sepr���r���r���r���%���s����)�ChainMapc�������������������s ���e�Zd�ZdZ��fdd�Z���ZS�)�_TemplateMetaclassa/�� %(delim)s(?: (?P<escaped>%(delim)s) | # Escape sequence of two delimiters (?P<named>%(id)s) | # delimiter and a Python identifier {(?P<braced>%(id)s)} | # delimiter and a braced identifier (?P<invalid>) # Other ill-formed delimiter exprs ) c����������������sX���t�t|��j|||��d|kr$|�j}ntjtj|�j�|�jd��}tj||�j tj B��|�_d�S�)N�pattern)Zdelim�id)�superr����__init__r����_re�escape� delimiter� idpattern�compile�flags�VERBOSE)�cls�name�basesZdctr���)� __class__r���r���r���A���s���� z_TemplateMetaclass.__init__)�__name__� __module__�__qualname__r���r���� __classcell__r���r���)r*���r���r���7���s���r���c���������������@���s>���e�Zd�ZdZdZdZejZdd��Z dd��Z dd ��Zd d��ZdS�) r���z.A string class for supporting $-substitutions.�$z(?-i:[_a-zA-Z][_a-zA-Z0-9]*)c�������������C���s ���||�_�d�S�)N)�template)�selfr0���r���r���r���r���X���s����zTemplate.__init__c�������������C���sd���|j�d�}|�jd�|��jdd�}|s.d}d}n"|tdj|d�d�����}t|�}td||f���d�S�)N�invalidT)�keepends������z.Invalid placeholder in string: line %d, col %d���)�startr0���� splitlines�lenr���� ValueError)r1����mo�i�lines�colno�linenor���r���r����_invalid]���s���� zTemplate._invalidc�����������������sl���|�st�d��|�^�}�t|��dkr(t�d��|�s2|��n|rFt||�d����n|�d������fdd�}�jj|�j�S�)Nz>descriptor 'substitute' of 'Template' object needs an argumentr4���zToo many positional argumentsr ���c����������������sd���|�j�d�p|�j�d�}|d�k r(t��|��S�|�j�d�d�k r<�jS�|�j�d�d�k rT�j|���td�j��d�S�)N�named�braced�escapedr2���z#Unrecognized named group in pattern)�group�strr"���r@���r:���r���)r;���rA���)�mappingr1���r���r����convertw���s���� z$Template.substitute.<locals>.convert)� TypeErrorr9���� _ChainMapr����subr0���)�args�kwsrG���r���)rF���r1���r���� substitutei���s����zTemplate.substitutec�����������������sl���|�st�d��|�^�}�t|��dkr(t�d��|�s2|��n|rFt||�d����n|�d������fdd�}�jj|�j�S�)NzCdescriptor 'safe_substitute' of 'Template' object needs an argumentr4���zToo many positional argumentsr ���c����������������s|���|�j�d�p|�j�d�}|d�k rByt��|��S��tk r@���|�j���S�X�|�j�d�d�k rV�jS�|�j�d�d�k rl|�j���S�td�j��d�S�)NrA���rB���rC���r2���z#Unrecognized named group in pattern)rD���rE����KeyErrorr"���r:���r���)r;���rA���)rF���r1���r���r���rG�������s���� z)Template.safe_substitute.<locals>.convert)rH���r9���rI���r���rJ���r0���)rK���rL���rG���r���)rF���r1���r����safe_substitute����s���� zTemplate.safe_substituteN) r+���r,���r-����__doc__r"���r#���r ���� IGNORECASEr%���r���r@���rM���rO���r���r���r���r���r���M���s���)� metaclassc���������������@���sV���e�Zd�Zdd��Zdd��Zddd�Zdd ��Zd d��Zdd ��Zdd��Z dd��Z dd��ZdS�)r���c��������������O���sz���|�st�d��|�^}}�y|�^}}�W�nJ�tk rj���d|kr\|jd�}dd�l}|jdtdd��n t�d�d��Y�nX�|j||�|�S�)Nz;descriptor 'format' of 'Formatter' object needs an argument� format_stringr ���z9Passing 'format_string' as keyword argument is deprecated����)� stacklevelz@format() missing 1 required positional argument: 'format_string')rH���r:����pop�warnings�warn�DeprecationWarning�vformat)rK����kwargsr1���rS���rW���r���r���r����format����s���� zFormatter.formatc�������������C���s.���t���}|�j||||d�\}}|�j|||��|S�)NrT���)�set�_vformat�check_unused_args)r1���rS���rK���r[���� used_args�result�_r���r���r���rZ�������s����zFormatter.vformatr ���c���������� ���C���s����|dk�rt�d��g�}x�|�j|�D�]�\}} } }|r:|j|��| d�k r | dkrl|dkrZt�d��t|�} |d7�}n| j��r�|r�t�d��d}|�j| ||�\}} |j| ��|�j||�}|�j| ||||d�|d�\} }|j|�j || ���q W�dj |�|fS�)Nr ���zMax string recursion exceededr5���FzJcannot switch from manual field specification to automatic field numberingr4���)�auto_arg_index)r:����parse�appendrE����isdigit� get_field�add� convert_fieldr^����format_fieldr���)r1���rS���rK���r[���r`���Zrecursion_depthrc���ra���Zliteral_text� field_name�format_spec� conversion�objZarg_usedr���r���r���r^�������s4���� zFormatter._vformatc�������������C���s���t�|t�r||�S�||�S�d�S�)N)� isinstance�int)r1����keyrK���r[���r���r���r���� get_value����s���� zFormatter.get_valuec�������������C���s���d�S�)Nr���)r1���r`���rK���r[���r���r���r���r_�����s����zFormatter.check_unused_argsc�������������C���s ���t�||�S�)N)r\���)r1����valuerl���r���r���r���rj�����s����zFormatter.format_fieldc�������������C���sN���|d�kr|S�|dkrt�|�S�|dkr,t|�S�|dkr<t|�S�tdj|���d�S�)Nr����r�az"Unknown conversion specifier {0!s})rE����repr�asciir:���r\���)r1���rs���rm���r���r���r���ri�����s����zFormatter.convert_fieldc�������������C���s ���t�j|�S�)N)�_stringZformatter_parser)r1���rS���r���r���r���rd�����s����zFormatter.parsec������� ������C���sN���t�j|�\}}|�j|||�}x(|D�] \}}|r:t||�}q"||�}q"W�||fS�)N)rx���Zformatter_field_name_splitrr����getattr) r1���rk���rK���r[����first�restrn���Zis_attrr<���r���r���r���rg���(��s����zFormatter.get_fieldN)r ���)r+���r,���r-���r\���rZ���r^���rr���r_���rj���ri���rd���rg���r���r���r���r���r�������s��� 5 )N)rP����__all__rx���r ���r���r���r���r���r���r���r ���r���r����rer ����collectionsr���rI����typer���r���r���r���r���r���r����<module>���s&��� `