Viewing File: /usr/lib/python3.6/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-36.pyc

3

aja@sddlmZddlZddlZddlZyddlZWnek
rHdZYnXejddkr~ddlmZe	fZ
eZddl
mZddlZddlZddlmZddlmZmZmZmZmZdd	lmZmZmZm Z m!Z!m"Z"m#Z#d
dZddl$Z$ddl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-er&dd
l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;ddZ<nddl=mZe>fZ
e>Zddl=m?ZddlZddlZddlZddl@mZmZmZm<Z<mZmZmZmZm#Z#ddlAm&Z&mZm%Z%m Z m!Z!m)Z)m*Z*m+Z+m,Z,m-Z-er&dd
lAm.Z.ddlBm(Z(m'Z'm"Z"ddlCjDZ/ddlAjEZ$ddlFjDZ0ddl2Z2ddlGm3Z3ddlHjIZ4eJZ5ddl6m:Z:e8Z8yddlmKZKmLZLWn8ek
rGdddeMZLdcddZNddZKYnXyddl
mOZPWn&ek
rGd d!d!eQZPYnXydd"lmRZRWn,ek
rLejSejTBdfd#d$ZRYnXdd%lUmVZWeXeWd&rleWZVn,dd'lUmYZZGd(d)d)eZZYGd*d+d+eWZVydd,l[m\Z\Wnek
rd-d.Z\YnXyddl]Z]Wn"ek
rdd/lm]Z]YnXye^Z^Wn*e_k
r*dd0l`maZad1d2Z^YnXyejbZbejcZcWnBedk
r~ejeZfefd3krfd4Zgnd5Zgd6d7Zbd8d9ZcYnXydd:lhmiZiWnHek
rdd;ljmkZkmlZlddlZejmd<Znd=d>Zod?d@ZiYnXyddAlpmqZqWn"ek
rddAlrmqZqYnXejddBddkr,e3jsZsnddDlpmsZsyddEl`mtZtWndek
rddFl`muZuyddGlvmwZxWn ek
rdedIdJZxYnXGdKdLdLeuZtYnXyddMlymzZzWn ek
rdfdNdOZzYnXyddPl`m{Z{Wnek
rzyddQl|m}Z~Wn"ek
r4ddQlm}Z~YnXyddRlmZmZmZWnek
rdYnXGdSdTdTeZ{YnXyddUlmZmZWnvek
rejmdVejZdWdXZGdYdZdZeZdgd[d\ZGd]d^d^eZGd_d`d`eZGdadbdbeQZYnXdS)h)absolute_importN)StringIO)FileType)shutil)urlparse
urlunparseurljoinurlsplit
urlunsplit)urlretrievequoteunquoteurl2pathnamepathname2urlContentTooShortError	splittypecCst|tr|jd}t|S)Nzutf-8)
isinstanceunicodeencode_quote)sr/usr/lib/python3.6/compat.pyrs

r)	RequesturlopenURLError	HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgrHTTPHandlerHTTPRedirectHandlerbuild_opener)HTTPSHandler)
HTMLParser)ifilter)ifilterfalsecCs<tdkrddl}|jdatj|}|r4|jddSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz^(.*)@(.*)$r)	_userprogrecompilematchgroup)hostr*r,rrr	splituser4s

r/)
TextIOWrapper)	rr	r
r/rrrrr)
rr
rrrrr r!r"r#)rrr)filterfalse)match_hostnameCertificateErrorc@seZdZdS)r3N)__name__
__module____qualname__rrrrr3^sr3c
Csg}|sdS|jd}|d|dd}}|jd}||krNtdt||sb|j|jkS|dkrv|jdn>|jd	s|jd	r|jtj|n|jtj|j	d
dx|D]}|jtj|qWtj
dd
j|dtj}	|	j
|S)zpMatching according to RFC 6125, section 6.4.3

        http://tools.ietf.org/html/rfc6125#section-6.4.3
        F.rrN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr3reprlowerappend
startswithr*escapereplacer+join
IGNORECASEr,)
ZdnhostnameZ
max_wildcardsZpatspartsZleftmostZ	remainderZ	wildcardsfragZpatrrr_dnsname_matchbs(


rFcCs|stdg}|jdf}x0|D](\}}|dkr"t||r@dS|j|q"W|sxF|jdfD]6}x0|D](\}}|dkrjt||rdS|j|qjWq`Wt|dkrtd|d	jtt|fn*t|dkrtd
||dfntddS)
a=Verify that *cert* (in decoded format as returned by
        SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
        rules are followed, but IP addresses are not accepted for *hostname*.

        CertificateError is raised on failure. On success, the function
        returns nothing.
        ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNameZDNSNZsubjectZ
commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)	
ValueErrorgetrFr=lenr3rAmapr;)ZcertrCZdnsnamesZsankeyvaluesubrrrr2s.

r2)SimpleNamespacec@seZdZdZddZdS)	ContainerzR
        A generic container for when multiple values need to be returned
        cKs|jj|dS)N)__dict__update)selfkwargsrrr__init__szContainer.__init__N)r4r5r6__doc__rTrrrrrOsrO)whichcs"dd}tjjr&||r"SdS|dkr>tjjdtj}|sFdS|jtj}tj	dkrtj
|krt|jdtj
tjjddjtj}tfd	d
|Drg}q‡fdd|D}ng}t
}xT|D]L}tjj|}||kr|j|x(|D] }	tjj||	}
||
|r|
SqWqWdS)
aKGiven a command, mode, and a PATH string, return the path which
        conforms to the given mode on the PATH, or None if there is no such
        file.

        `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
        of os.environ.get("PATH"), or can be overridden with a custom search
        path.

        cSs&tjj|o$tj||o$tjj|S)N)ospathexistsaccessisdir)fnmoderrr
_access_checkszwhich.<locals>._access_checkNPATHZwin32rZPATHEXTc3s |]}jj|jVqdS)N)r<endswith).0ext)cmdrr	<genexpr>szwhich.<locals>.<genexpr>csg|]}|qSrr)rbrc)rdrr
<listcomp>szwhich.<locals>.<listcomp>)rWrXdirnameenvironrHdefpathr9pathsepsysplatformcurdirinsertanysetnormcaseaddrA)rdr]rXr^ZpathextfilesseendirZnormdirZthefilenamer)rdrrVs8







rV)ZipFile	__enter__)
ZipExtFilec@s$eZdZddZddZddZdS)rycCs|jj|jdS)N)rPrQ)rRbaserrrrTszZipExtFile.__init__cCs|S)Nr)rRrrrrxszZipExtFile.__enter__cGs|jdS)N)close)rRexc_inforrr__exit__szZipExtFile.__exit__N)r4r5r6rTrxr}rrrrrysryc@s$eZdZddZddZddZdS)rwcCs|S)Nr)rRrrrrx"szZipFile.__enter__cGs|jdS)N)r{)rRr|rrrr}%szZipFile.__exit__cOstj|f||}t|S)N)BaseZipFileopenry)rRargsrSrzrrrr)szZipFile.openN)r4r5r6rxr}rrrrrrw!srw)python_implementationcCs0dtjkrdStjdkrdStjjdr,dSdS)z6Return a string identifying the Python implementation.ZPyPyjavaZJythonZ
IronPythonZCPython)rkversionrWrvr>rrrrr0s

r)	sysconfig)CallablecCs
t|tS)N)rr)objrrrcallableDsrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|jttStdt|jdS)Nzexpect bytes or str, not %s)	rbytes	text_typer_fsencoding	_fserrors	TypeErrortyper4)filenamerrrfsencodeRs

rcCs:t|tr|St|tr$|jttStdt|jdS)Nzexpect bytes or str, not %s)	rrrdecoderrrrr4)rrrrfsdecode[s

r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|ddjjdd}|dks*|jdr.dS|d
ks@|jdrDdS|S)z(Imitates get_normal_name in tokenizer.c.N_-zutf-8zutf-8-latin-1
iso-8859-1iso-latin-1latin-1-iso-8859-1-iso-latin-1-)rrr)rrr)r<r@r>)orig_encencrrr_get_normal_namels
rcsyjjWntk
r$dYnXdd}d}fdd}fdd}|}|jtrpd|d	d}d
}|s||gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS)a?
        The detect_encoding() function is used to detect the encoding that should
        be used to decode a Python source file.  It requires one argument, readline,
        in the same way as the tokenize() generator.

        It will call readline a maximum of twice, and return the encoding used
        (as a string) and a list of any lines (left as bytes) it has read in.

        It detects the encoding from the presence of a utf-8 bom or an encoding
        cookie as specified in pep-0263.  If both a bom and a cookie are present,
        but disagree, a SyntaxError will be raised.  If the encoding cookie is an
        invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
        'utf-8-sig' is returned.

        If no encoding is specified, then the default of 'utf-8' will be returned.
        NFzutf-8cs yStk
rdSXdS)N)
StopIterationr)readlinerrread_or_stopsz%detect_encoding.<locals>.read_or_stopcsy|jd}Wn4tk
rBd}dk	r6dj|}t|YnXtj|}|sVdSt|d}yt|}Wn:tk
rdkrd|}ndj|}t|YnXr|j	dkr؈dkrd}n
dj}t||d	7}|S)
Nzutf-8z'invalid or missing encoding declarationz{} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
rUnicodeDecodeErrorformatSyntaxError	cookie_refindallrrLookupErrorrv)lineline_stringmsgZmatchesencodingcodec)	bom_foundrrrfind_cookies6



z$detect_encoding.<locals>.find_cookieTrz	utf-8-sig)__self__rvAttributeErrorr>r)rrdefaultrrfirstsecondr)rrrrrws4
&


r)r?r()unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm
            Decorator to make a repr function return fillvalue for a recursive
            call
            csLtfdd}td|_td|_td|_tdi|_|S)NcsBt|tf}|krSj|z|}Wdj|X|S)N)id	get_identrrdiscard)rRrKresult)	fillvaluerepr_running
user_functionrrwrappers
z=_recursive_repr.<locals>.decorating_function.<locals>.wrapperr5rUr4__annotations__)rpgetattrr5rUr4r)rr)r)rrrdecorating_functionsz,_recursive_repr.<locals>.decorating_functionr)rrr)rr_recursive_reprsrc@seZdZdZddZddZddZd'd	d
ZddZd
dZ	ddZ
ddZeddZ
eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together
        to create a single, updateable view.

        The underlying mappings are stored in a list.  That list is public and can
        accessed or updated using the *maps* attribute.  There is no other state.

        Lookups search the underlying mappings successively until a key is found.
        In contrast, writes, updates, and deletions only operate on the first
        mapping.

        cGst|pig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings.
            If no mappings are provided, a single empty dictionary is used.

            N)listmaps)rRrrrrrT
szChainMap.__init__cCst|dS)N)KeyError)rRrKrrr__missing__szChainMap.__missing__cCs8x,|jD]"}y||Stk
r(YqXqW|j|S)N)rrr)rRrKmappingrrr__getitem__s
zChainMap.__getitem__NcCs||kr||S|S)Nr)rRrKrrrrrHszChainMap.getcCsttj|jS)N)rIrpunionr)rRrrr__len__"szChainMap.__len__cCsttj|jS)N)iterrprr)rRrrr__iter__%szChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdS)Nr)rbm)rKrrre)sz(ChainMap.__contains__.<locals>.<genexpr>)ror)rRrKr)rKr__contains__(szChainMap.__contains__cCs
t|jS)N)ror)rRrrr__bool__+szChainMap.__bool__cCsdj|djtt|jS)Nz{0.__class__.__name__}({1})z, )rrArJr;r)rRrrr__repr__.szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr3szChainMap.fromkeyscCs$|j|jdjf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN)	__class__rcopy)rRrrrr8sz
ChainMap.copycCs|jif|jS)z;New ChainMap with a new dict followed by all previous maps.)rr)rRrrr	new_child>szChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rN)rr)rRrrrparentsBszChainMap.parentscCs||jd|<dS)Nr)r)rRrKrLrrr__setitem__GszChainMap.__setitem__cCs8y|jd|=Wn"tk
r2tdj|YnXdS)Nrz(Key not found in the first mapping: {!r})rrr)rRrKrrr__delitem__JszChainMap.__delitem__cCs0y|jdjStk
r*tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemr)rRrrrrPszChainMap.popitemcGs>y|jdj|f|Stk
r8tdj|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rz(Key not found in the first mapping: {!r}N)rpoprr)rRrKrrrrrWszChainMap.popcCs|jdjdS)z'Clear maps[0], leaving maps[1:] intact.rN)rclear)rRrrrr^szChainMap.clear)N)r4r5r6rUrTrrrHrrrrrrclassmethodrr__copy__rpropertyrrrrrrrrrrrs(
r)cache_from_sourcecCs0|jdst|dkrd}|r$d}nd}||S)Nz.pyTco)raAssertionError)rXdebug_overridesuffixrrrresr)OrderedDict)r)KeysView
ValuesView	ItemsViewc@seZdZdZddZejfddZejfddZdd	Zd
dZ	dd
Z
d6ddZddZddZ
ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):rz)Dictionary that remembers insertion ordercOsnt|dkrtdt|y
|jWn6tk
r\g|_}||dg|dd<i|_YnX|j||dS)zInitialize an ordered dictionary.  Signature is the same as for
            regular dictionaries, but keyword arguments are not recommended
            because their insertion order is arbitrary.

            rz$expected at most 1 arguments, got %dN)rIr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rRrkwdsrootrrrrTs

zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)rRrKrLZdict_setitemrlastrrrrs
 zOrderedDict.__setitem__cCs0||||jj|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr)rRrKZdict_delitem	link_prev	link_nextrrrrs
zOrderedDict.__delitem__ccs2|j}|d}x||k	r,|dV|d}qWdS)zod.__iter__() <==> iter(od)rr(N)r)rRrcurrrrrrs


zOrderedDict.__iter__ccs2|j}|d}x||k	r,|dV|d}qWdS)z#od.__reversed__() <==> reversed(od)rr(N)r)rRrrrrr__reversed__s


zOrderedDict.__reversed__cCshyDx|jjD]}|dd=qW|j}||dg|dd<|jjWntk
rXYnXtj|dS)z.od.clear() -> None.  Remove all items from od.N)r
itervaluesrrrr)rRZnoderrrrrszOrderedDict.clearTcCs||std|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=tj||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair.
            Pairs are returned in LIFO order if last is true or FIFO order if false.

            zdictionary is emptyrrr()rrrrr)rRrrlinkrrrKrLrrrrs 
zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)r)rRrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|]}|qSrr)rbrK)rRrrrfsz&OrderedDict.values.<locals>.<listcomp>r)rRr)rRrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrr)rbrK)rRrrrfsz%OrderedDict.items.<locals>.<listcomp>r)rRr)rRritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)r)rRrrriterkeysszOrderedDict.iterkeysccsx|D]}||VqWdS)z2od.itervalues -> an iterator over the values in odNr)rRkrrrrs
zOrderedDict.itervaluesccs x|D]}|||fVqWdS)z=od.iteritems -> an iterator over the (key, value) items in odNr)rRrrrr	iteritemss
zOrderedDict.iteritemscOst|dkr tdt|fn|s,td|d}f}t|dkrL|d}t|trrx^|D]}||||<q\WnDt|drx8|jD]}||||<qWnx|D]\}}|||<qWx|jD]\}}|||<qWdS)aod.update(E, **F) -> None.  Update od from dict/iterable E and F.

            If E is a dict instance, does:           for k in E: od[k] = E[k]
            If E has a .keys() method, does:         for k in E.keys(): od[k] = E[k]
            Or if E is an iterable of items, does:   for k, v in E: od[k] = v
            In either case, this is followed by:     for k, v in F.items(): od[k] = v

            r(z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrN)rIrrrhasattrrr)rrrRotherrKrLrrrrQs&	


zOrderedDict.updatecCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value.
            If key is not found, d is returned if given, otherwise KeyError is raised.

            )_OrderedDict__markerr)rRrKrrrrrr!s
zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr)rRrKrrrr
setdefault.szOrderedDict.setdefaultcCs^|si}t|tf}||kr"dSd||<z&|s>d|jjfSd|jj|jfS||=XdS)zod.__repr__() <==> repr(od)z...rz%s()z%s(%r)N)r
_get_identrr4r)rRZ
_repr_runningZcall_keyrrrr5szOrderedDict.__repr__cs\fddD}tj}xttD]}|j|dq*W|rPj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrr)rbr)rRrrrfEsz*OrderedDict.__reduce__.<locals>.<listcomp>N)varsrrrr)rRrZ	inst_dictrr)rRr
__reduce__CszOrderedDict.__reduce__cCs
|j|S)z!od.copy() -> a shallow copy of od)r)rRrrrrMszOrderedDict.copycCs |}x|D]}|||<qW|S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
            and values equal to v (which defaults to None).

            r)rrrLdrKrrrrQs
zOrderedDict.fromkeyscCs6t|tr*t|t|ko(|j|jkStj||S)zod.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
            while comparison to a regular mapping is order-insensitive.

            )rrrIrr__eq__)rRrrrrr\s
 zOrderedDict.__eq__cCs
||kS)Nr)rRrrrr__ne__eszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r)rRrrrviewkeysjszOrderedDict.viewkeyscCst|S)z<od.viewvalues() -> an object providing a view on od's values)r)rRrrr
viewvaluesnszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)r)rRrrr	viewitemsrszOrderedDict.viewitems)T)N)N)N)"r4r5r6rUrTrrrrrrrrrrrrrrQrobjectrrr	rrrrrrrrrrrrrrrs:
	




	r)BaseConfiguratorvalid_identz^[a-z_][a-z0-9_]*$cCstj|}|std|dS)Nz!Not a valid Python identifier: %rT)
IDENTIFIERr,rG)rrrrrr|s
rc@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJtj||}|jj|}||k	rF|||<t|tttfkrF||_||_	|S)N)
rrconfiguratorconvertrrConvertingListConvertingTupleparentrK)rRrKrLrrrrrs
zConvertingDict.__getitem__NcCsLtj|||}|jj|}||k	rH|||<t|tttfkrH||_||_	|S)N)
rrHrrrrrrrrK)rRrKrrLrrrrrHs
zConvertingDict.get)N)r4r5r6rUrrHrrrrrsrcCsDtj|||}|jj|}||k	r@t|tttfkr@||_||_	|S)N)
rrrrrrrrrrK)rRrKrrLrrrrrs
rc@s"eZdZdZddZd	ddZdS)
rzA converting list wrapper.cCsJtj||}|jj|}||k	rF|||<t|tttfkrF||_||_	|S)N)
rrrrrrrrrrK)rRrKrLrrrrrs
zConvertingList.__getitem__rcCs<tj||}|jj|}||k	r8t|tttfkr8||_|S)N)	rrrrrrrrr)rRidxrLrrrrrs
zConvertingList.popN)r)r4r5r6rUrrrrrrrsrc@seZdZdZddZdS)rzA converting tuple wrapper.cCsBtj||}|jj|}||k	r>t|tttfkr>||_||_	|S)N)
tuplerrrrrrrrrK)rRrKrLrrrrrs
zConvertingTuple.__getitem__N)r4r5r6rUrrrrrrsrc@seZdZdZejdZejdZejdZejdZ	ejdZ
ddd	Zee
Zd
dZdd
ZddZddZddZddZddZdS)rzQ
        The configurator base class which defines some useful defaults.
        z%^(?P<prefix>[a-z]+)://(?P<suffix>.*)$z^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ext_convertcfg_convert)rcZcfgcCst||_||j_dS)N)rconfigr)rRr"rrrrTs
zBaseConfigurator.__init__c	Cs|jd}|jd}y`|j|}xP|D]H}|d|7}yt||}Wq&tk
rl|j|t||}Yq&Xq&W|Stk
rtjdd\}}td||f}|||_	|_
|YnXdS)zl
            Resolve strings to objects using standard import and attribute
            syntax.
            r7rrNzCannot resolve %r: %s)r9rimporterrrImportErrorrkr|rG	__cause__
__traceback__)	rRrrvZusedfoundrEetbvrrrresolves"




zBaseConfigurator.resolvecCs
|j|S)z*Default converter for the ext:// protocol.)r+)rRrLrrrr szBaseConfigurator.ext_convertcCs|}|jj|}|dkr&td|n||jd}|j|jd}x|r|jj|}|rp||jd}nd|jj|}|r|jd}|jj|s||}n2yt	|}||}Wnt
k
r||}YnX|r||jd}qJtd||fqJW|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r)WORD_PATTERNr,rGendr"groupsDOT_PATTERN
INDEX_PATTERN
DIGIT_PATTERNintr)rRrLrestrr
rnrrrr!s2
zBaseConfigurator.cfg_convertcCst|tr&t|tr&t|}||_nt|trLt|trLt|}||_n|t|trrt|trrt|}||_nVt|tr|j	j
|}|r|j}|d}|jj
|d}|r|d}t||}||}|S)z
            Convert values to an appropriate type. dicts, lists and tuples are
            replaced by their converting alternatives. Strings are checked to
            see if they have a conversion format and are converted if they do.
            prefixNr)rrrrrrrrstring_typesCONVERT_PATTERNr,	groupdictvalue_convertersrHr)rRrLrr
r5Z	converterrrrrr)s*


zBaseConfigurator.convertcsrjd}t|s|j|}jdd}tfddD}|f|}|rnx |jD]\}}t|||qVW|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|r||fqSr)r)rbr)r"rrrfLsz5BaseConfigurator.configure_custom.<locals>.<listcomp>)rrr+rrsetattr)rRr"rZpropsrSrrvrLr)r"rconfigure_customEs


z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrr)rRrLrrras_tupleSs
zBaseConfigurator.as_tupleN)r4r5r6rUr*r+r7r,r/r0r1r9staticmethod
__import__r#rTr+r r!rr;r<rrrrrs 




"r)r)rr)r)N)N)Z
__future__rrWr*rkZsslr$version_inforZ
basestringr6rrtypesrZ	file_typeZ__builtin__builtinsZConfigParserZconfigparserZ	_backportrrr	r
rrZurllibr
rrrrrrrZurllib2rrrrrr r!r"r#r$ZhttplibZ	xmlrpclibZQueueZqueuer%ZhtmlentitydefsZ	raw_input	itertoolsr&filterr'r1r)r/iostrr0Zurllib.parseZurllib.requestZurllib.errorZhttp.clientZclientZrequestZ
xmlrpc.clientZhtml.parserZ
html.entitiesZentitiesinputr2r3rGrFrNrOrrVF_OKX_OKZzipfilerwr~rryZBaseZipExtFilerlrrr	NameErrorcollectionsrrrrgetfilesystemencodingrrtokenizercodecsrrr+rrZhtmlr?ZcgirrrreprlibrrZimprrZthreadrr
Zdummy_threadZ_abcollrrrrZlogging.configrrIrrrrrrrrrrr<module>s&
$,,0




2+A


		
[
b
w


Back to Directory File Manager