%PDF- %PDF-
Direktori : /usr/local/lib/python3.8/__pycache__/ |
Current File : //usr/local/lib/python3.8/__pycache__/string.cpython-38.pyc |
U na') @ s d Z ddddddddd d ddgZd dlZdZdZdZee ZdZed d ZdZ dZ ee e e ZdddZd dl Zd dlmZ i ZG dd deZG dd dedZG dd dZdS )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_lettersascii_lowercaseascii_uppercasecapwordsdigits hexdigits octdigits printablepunctuation whitespace FormatterTemplate Nz abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789ZabcdefZABCDEF01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~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).0x r "/usr/local/lib/python3.8/string.py <genexpr>0 s zcapwords.<locals>.<genexpr>)joinsplit)ssepr r r r % s )ChainMapc s e Zd ZdZ fddZ ZS )_TemplateMetaclassa/ %(delim)s(?: (?P<escaped>%(delim)s) | # Escape sequence of two delimiters (?P<named>%(id)s) | # delimiter and a Python identifier {(?P<braced>%(bid)s)} | # delimiter and a braced identifier (?P<invalid>) # Other ill-formed delimiter exprs ) c sb t t| ||| d|kr$| j}n$tjt| j| j| jp@| jd }t || j tjB | _d S )Npattern)delimidbid)superr __init__r _reescape delimiter idpatternbraceidpatterncompileflagsVERBOSE)clsnamebasesdctr __class__r r r% C s z_TemplateMetaclass.__init__)__name__ __module____qualname__r r% __classcell__r r r2 r r 9 s r c @ sJ e Zd ZdZdZdZdZejZ dd Z dd Zefd d Z efddZdS ) r z.A string class for supporting $-substitutions.$z(?a:[_a-z][_a-z0-9]*)Nc C s || _ d S r )template)selfr9 r r r r% \ s zTemplate.__init__c C sd | d}| jd | jdd}|s.d}d}n"|td|d d }t|}td||f d S )NinvalidT)keepends z.Invalid placeholder in string: line %d, col %d)startr9 splitlineslenr ValueError)r: moilinescolnolinenor r r _invalida s zTemplate._invalidc s: t kr| n|rt| fdd}j|jS )Nc sd | dp| d}|d k r(t | S | dd k r<jS | dd k rT| tdjd S Nnamedbracedescapedr; z#Unrecognized named group in pattern)groupstrr( rI rC r rD rK mappingr: r r converts s z$Template.substitute.<locals>.convert_sentinel_dict _ChainMapr subr9 r: rR kwsrS r rQ r substitutem s zTemplate.substitutec s: t kr| n|rt| fdd}j|jS )Nc s | dp| d}|d k rHzt | W S tk rF | Y S X | dd k r\jS | dd k rr| S tdjd S rJ )rN rO KeyErrorr( rC r rP rQ r r rS s z)Template.safe_substitute.<locals>.convertrT rX r rQ r safe_substitute s zTemplate.safe_substitute)r4 r5 r6 __doc__r( r) r* r&