3 ”ReÀ¡ã�@s:ddlmZddlZddlZddlZy ddlZWnek rHdZYnXejddk�r~ddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d d „Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-e�r&dd l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;dd„Z<�n ddl=mZe>fZ e>Z ddl=m?ZddlZddlZddlZddl@mZmZmZmd?„Zod@dA„ZiYnXyddBlpmqZqWn"ek �rddBlrmqZqYnXejddC…dek�r2e3ƒjsZsn ddElpmsZsyddFltmuZuWndek �r²ddGltmvZvyddHlwmxZyWn ek �rœdfdJdK„ZyYnXGdLdM„dMevƒZuYnXyddNlzm{Z{WnHek �r yddNl|m{Z{Wn ek �rdgdOdP„Z{YnXYnXyddQltm}Z}WnŠek �r¨yddRl~mZ€Wn"ek �rbddRl�mZ€YnXyddSl‚mƒZƒm„Z„m…Z…Wnek �r’YnXGdTdU„dUe†ƒZ}YnXyddVl‡mˆZˆm‰Z‰Wnvek �r4ejmdWejŠƒZ‹dXdY„Z‰GdZd[„d[e†ƒZŒdhd\d]„Z�Gd^d_„d_eŽƒZ�Gd`da„dae�ƒZ‘Gdbdc„dceQƒZˆYnXdS)ié)Úabsolute_importNé)ÚStringIO)ÚFileTypeé)Úshutil)ÚurlparseÚ urlunparseÚurljoinÚurlsplitÚ urlunsplit)Ú urlretrieveÚquoteÚunquoteÚ url2pathnameÚ pathname2urlÚContentTooShortErrorÚ splittypecCst|tƒr|jdƒ}t|ƒS)Nzutf-8)Ú isinstanceÚunicodeÚencodeÚ_quote)Ús©rú‰/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/distlib/compat.pyrs  r) ÚRequestÚurlopenÚURLErrorÚ HTTPErrorÚHTTPBasicAuthHandlerÚHTTPPasswordMgrÚ HTTPHandlerÚHTTPRedirectHandlerÚ build_opener)Ú HTTPSHandler)Ú HTMLParser)Úifilter)Ú ifilterfalsecCs<tdkrddl}|jdƒatj|ƒ}|r4|jddƒSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz ^(.*)@(.*)$ré)Ú _userprogÚreÚcompileÚmatchÚgroup)Úhostr*r,rrrÚ splituser4s   r/)Ú TextIOWrapper) rr r r/rrr r r) rr rrrrr r!r"r#)rrr)Ú filterfalse)Úmatch_hostnameÚCertificateErrorc@s eZdZdS)r3N)Ú__name__Ú __module__Ú __qualname__rrrrr3^sr3c Csøg}|s dS|jdƒ}|d|dd…}}|jdƒ}||krNtdt|ƒƒ‚|sb|jƒ|jƒkS|dkrv|jdƒn>|jd ƒsŠ|jd ƒrœ|jtj|ƒƒn|jtj|ƒj d d ƒƒx|D]}|jtj|ƒƒqºWtj 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)ÚsplitÚcountr3ÚreprÚlowerÚappendÚ startswithr*ÚescapeÚreplacer+ÚjoinÚ IGNORECASEr,) ÚdnÚhostnameÚ max_wildcardsÚpatsÚpartsÚleftmostÚ remainderÚ wildcardsÚfragÚpatrrrÚ_dnsname_matchbs(    rMcCsò|s tdƒ‚g}|jdfƒ}x0|D](\}}|dkr"t||ƒr@dS|j|ƒq"W|sšxF|jdfƒD]6}x0|D](\}}|dkrjt||ƒrˆdS|j|ƒqjWq`Wt|ƒdkrÄtd|d jtt|ƒƒfƒ‚n*t|ƒdkrætd ||d fƒ‚ntd ƒ‚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_REQUIREDÚsubjectAltNameÚDNSNÚsubjectÚ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) Ú ValueErrorÚgetrMr=Úlenr3rAÚmapr;)ÚcertrDÚdnsnamesÚsanÚkeyÚvalueÚsubrrrr2”s.     r2)ÚSimpleNamespacec@seZdZdZdd„ZdS)Ú ContainerzR A generic container for when multiple values need to be returned cKs|jj|ƒdS)N)Ú__dict__Úupdate)ÚselfÚkwargsrrrÚ__init__ÆszContainer.__init__N)r4r5r6Ú__doc__rbrrrrr]Âsr])Úwhichc s"dd„}tjjˆƒr&|ˆ|ƒr"ˆSdS|dkr>tjjdtjƒ}|sFdS|jtjƒ}tj dkr¼tj |krt|j dtj ƒtjjddƒjtjƒ}t ‡fd d „|Dƒƒr¨ˆg}q‡fd d „|Dƒ}nˆg}t ƒ}xT|D]L}tjj|ƒ}||krÎ|j|ƒx(|D] } tjj|| ƒ} || |ƒrö| SqöWqÎWdS) 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)ÚosÚpathÚexistsÚaccessÚisdir)ÚfnÚmoderrrÚ _access_checkÛszwhich.._access_checkNÚPATHÚwin32rÚPATHEXTÚc3s |]}ˆjƒj|jƒƒVqdS)N)r<Úendswith)Ú.0Úext)Úcmdrrú øszwhich..csg|] }ˆ|‘qSrr)rrrs)rtrrú ûszwhich..)rerfÚdirnameÚenvironrSÚdefpathr9ÚpathsepÚsysÚplatformÚcurdirÚinsertÚanyÚsetÚnormcaseÚaddrA) rtrkrfrlÚpathextÚfilesÚseenÚdirÚnormdirÚthefileÚnamer)rtrrdÎs8            rd)ÚZipFileÚ __enter__)Ú ZipExtFilec@s$eZdZdd„Zdd„Zdd„ZdS)rŒcCs|jj|jƒdS)N)r^r_)r`ÚbaserrrrbszZipExtFile.__init__cCs|S)Nr)r`rrrr‹szZipExtFile.__enter__cGs |jƒdS)N)Úclose)r`Úexc_inforrrÚ__exit__szZipExtFile.__exit__N)r4r5r6rbr‹r�rrrrrŒsrŒc@s$eZdZdd„Zdd„Zdd„ZdS)rŠcCs|S)Nr)r`rrrr‹"szZipFile.__enter__cGs |jƒdS)N)rŽ)r`r�rrrr�%szZipFile.__exit__cOstj|f|ž|Ž}t|ƒS)N)Ú BaseZipFileÚopenrŒ)r`Úargsrar�rrrr’)sz ZipFile.openN)r4r5r6r‹r�r’rrrrrŠ!srŠ)Úpython_implementationcCs0dtjkrdStjdkrdStjjdƒr,dSdS)z6Return a string identifying the Python implementation.ÚPyPyÚjavaÚJythonÚ IronPythonÚCPython)r{Úversionrer‰r>rrrrr”0s   r”)Ú sysconfig)ÚCallablecCs t|tƒS)N)rrœ)ÚobjrrrÚcallableDsržzutf-8ÚmbcsÚstrictÚsurrogateescapecCs:t|tƒr|St|tƒr$|jttƒStdt|ƒjƒ‚dS)Nzexpect bytes or str, not %s) rÚbytesÚ text_typerÚ _fsencodingÚ _fserrorsÚ TypeErrorÚtyper4)ÚfilenamerrrÚfsencodeXs    r©cCs:t|tƒr|St|tƒr$|jttƒStdt|ƒjƒ‚dS)Nzexpect bytes or str, not %s) rr£r¢Údecoder¤r¥r¦r§r4)r¨rrrÚfsdecodeas    r«)Údetect_encoding)ÚBOM_UTF8Úlookupzcoding[:=]\s*([-\w.]+)cCsH|dd…jƒjddƒ}|dks*|jdƒr.dS|d ks@|jdƒrDdS|S)z(Imitates get_normal_name in tokenizer.c.Né Ú_ú-zutf-8zutf-8-úlatin-1ú iso-8859-1ú iso-latin-1úlatin-1-ú iso-8859-1-ú iso-latin-1-)r²r³r´)rµr¶r·)r<r@r>)Úorig_encÚencrrrÚ_get_normal_namers rºc sÊy ˆjj‰Wntk r$d‰YnXd‰d}d}‡fdd„}‡‡fdd„}|ƒ}|jtƒrpd‰|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-8c s yˆƒStk rdSXdS)Nó)Ú StopIterationr)ÚreadlinerrÚ read_or_stop•sz%detect_encoding..read_or_stopcsäy|jdƒ}Wn4tk rBd}ˆdk r6dj|ˆƒ}t|ƒ‚YnXtj|ƒ}|sVdSt|dƒ}y t|ƒ}Wn:tk r¨ˆdkr�d|}n djˆ|ƒ}t|ƒ‚YnXˆrà|j dkr؈dkrÆd}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) rªÚUnicodeDecodeErrorÚformatÚ SyntaxErrorÚ cookie_reÚfindallrºr®Ú LookupErrorr‰)ÚlineÚ line_stringÚmsgÚmatchesÚencodingÚcodec)Ú bom_foundr¨rrÚ find_cookie›s6       z$detect_encoding..find_cookieTrz utf-8-sig)Ú__self__r‰ÚAttributeErrorr>r­)r½rÉÚdefaultr¾rÌÚfirstÚsecondr)rËr¨r½rr¬}s4   &     r¬)r?r(é)Úunescape)ÚChainMap)ÚMutableMapping)Úrecursive_reprú...cs‡fdd„}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtƒ‰‡‡‡fdd„}tˆdƒ|_tˆdƒ|_tˆdƒ|_tˆdiƒ|_|S)Nc sBt|ƒtƒf}|ˆkrˆSˆj|ƒz ˆ|ƒ}Wdˆj|ƒX|S)N)ÚidÚ get_identr‚Údiscard)r`rYÚresult)Ú fillvalueÚ repr_runningÚ user_functionrrÚwrapperòs   z=_recursive_repr..decorating_function..wrapperr5rcr4Ú__annotations__)r€Úgetattrr5rcr4rà)rÞrß)rÜ)rÝrÞrÚdecorating_functionïs   z,_recursive_repr..decorating_functionr)rÜrâr)rÜrÚ_recursive_représ rãc@s´eZdZdZdd„Zdd„Zdd„Zd'd d „Zd d „Zd d„Z dd„Z dd„Z e ƒdd„ƒZ edd„ƒZdd„ZeZdd„Zedd„ƒZdd„Zdd „Zd!d"„Zd#d$„Zd%d&„ZdS)(rÔaÍ 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)z˜Initialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)ÚlistÚmaps)r`rårrrrbszChainMap.__init__cCs t|ƒ‚dS)N)ÚKeyError)r`rYrrrÚ __missing__szChainMap.__missing__c Cs8x,|jD]"}y||Stk r(YqXqW|j|ƒS)N)rårærç)r`rYÚmappingrrrÚ __getitem__s   zChainMap.__getitem__NcCs||kr||S|S)Nr)r`rYrÏrrrrS%sz ChainMap.getcCsttƒj|jŽƒS)N)rTr€Úunionrå)r`rrrÚ__len__(szChainMap.__len__cCsttƒj|jŽƒS)N)Úiterr€rêrå)r`rrrÚ__iter__+szChainMap.__iter__cst‡fdd„|jDƒƒS)Nc3s|]}ˆ|kVqdS)Nr)rrÚm)rYrrru/sz(ChainMap.__contains__..)rrå)r`rYr)rYrÚ __contains__.szChainMap.__contains__cCs t|jƒS)N)rrå)r`rrrÚ__bool__1szChainMap.__bool__cCsdj|djtt|jƒƒƒS)Nz{0.__class__.__name__}({1})z, )rÀrArUr;rå)r`rrrÚ__repr__4szChainMap.__repr__cGs|tj|f|žŽƒS)z?Create a ChainMap with a single dict created from the iterable.)ÚdictÚfromkeys)ÚclsÚiterabler“rrrró9szChainMap.fromkeyscCs$|j|jdjƒf|jdd…žŽS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN)Ú __class__råÚcopy)r`rrrr÷>sz ChainMap.copycCs|jif|jžŽS)z;New ChainMap with a new dict followed by all previous maps.)rörå)r`rrrÚ new_childDszChainMap.new_childcCs|j|jdd…ŽS)zNew ChainMap from maps[1:].rN)rörå)r`rrrÚparentsHszChainMap.parentscCs||jd|<dS)Nr)rå)r`rYrZrrrÚ __setitem__MszChainMap.__setitem__c Cs8y|jd|=Wn"tk r2tdj|ƒƒ‚YnXdS)Nrz(Key not found in the first mapping: {!r})rårærÀ)r`rYrrrÚ __delitem__PszChainMap.__delitem__c Cs0y|jdjƒStk r*tdƒ‚YnXdS)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)råÚpopitemræ)r`rrrrüVszChainMap.popitemc Gs>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)råÚpoprærÀ)r`rYr“rrrrý]sz ChainMap.popcCs|jdjƒdS)z'Clear maps[0], leaving maps[1:] intact.rN)råÚclear)r`rrrrþdszChainMap.clear)N)r4r5r6rcrbrçrérSrërírïrðrãrñÚ classmethodrór÷Ú__copy__røÚpropertyrùrúrûrürýrþrrrrrÔs(    rÔ)Úcache_from_sourcecCs0|jdƒst‚|dkrd}|r$d}nd}||S)Nz.pyTÚcÚo)rqÚAssertionError)rfÚdebug_overrideÚsuffixrrrrnsr)Ú OrderedDict)rÙ)ÚKeysViewÚ ValuesViewÚ ItemsViewc@sþeZdZdZdd„Zejfdd„Zejfdd„Zdd „Zd d „Z d d „Z d6dd„Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„ZeZeƒZefdd „Zd7d"d#„Zd8d$d%„Zd&d'„Zd(d)„Zed9d*d+„ƒZd,d-„Zd.d/„Zd0d1„Zd2d3„Z d4d5„Z!d!S):rz)Dictionary that remembers insertion orderc Osnt|ƒdkrtdt|ƒƒ‚y |jWn6tk r\g|_}||dg|dd…<i|_YnX|j||ŽdS)zÑInitialize 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)rTr¦Ú_OrderedDict__rootrÎÚ_OrderedDict__mapÚ_OrderedDict__update)r`r“ÚkwdsÚrootrrrrb•s    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||ƒdS)z!od.__setitem__(i, y) <==> od[i]=yrrN)r r )r`rYrZZ dict_setitemrÚlastrrrrú¥s  zOrderedDict.__setitem__cCs0|||ƒ|jj|ƒ\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)r rý)r`rYZ dict_delitemÚ link_prevÚ link_nextrrrrû¯s zOrderedDict.__delitem__ccs2|j}|d}x||k r,|dV|d}qWdS)zod.__iter__() <==> iter(od)rr(N)r )r`rÚcurrrrrrí¸s   zOrderedDict.__iter__ccs2|j}|d}x||k r,|dV|d}qWdS)z#od.__reversed__() <==> reversed(od)rr(N)r )r`rrrrrÚ __reversed__Às   zOrderedDict.__reversed__c CshyDx|jjƒD]}|dd…=qW|j}||dg|dd…<|jjƒWntk rXYnXtj|ƒdS)z.od.clear() -> None. Remove all items from od.N)r Ú itervaluesr rþrÎrò)r`ÚnoderrrrrþÈszOrderedDict.clearTcCs||s tdƒ‚|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=tj||ƒ}||fS)z¡od.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()rær r ròrý)r`rrÚlinkrrrYrZrrrrüÔs   zOrderedDict.popitemcCst|ƒS)zod.keys() -> list of keys in od)rä)r`rrrÚkeysíszOrderedDict.keyscs‡fdd„ˆDƒS)z#od.values() -> list of values in odcsg|] }ˆ|‘qSrr)rrrY)r`rrrvósz&OrderedDict.values..r)r`r)r`rÚvaluesñszOrderedDict.valuescs‡fdd„ˆDƒS)z.od.items() -> list of (key, value) pairs in odcsg|]}|ˆ|f‘qSrr)rrrY)r`rrrv÷sz%OrderedDict.items..r)r`r)r`rÚitemsõszOrderedDict.itemscCst|ƒS)z0od.iterkeys() -> an iterator over the keys in od)rì)r`rrrÚiterkeysùszOrderedDict.iterkeysccsx|D]}||VqWdS)z2od.itervalues -> an iterator over the values in odNr)r`Úkrrrrýs zOrderedDict.itervaluesccs x|D]}|||fVqWdS)z=od.iteritems -> an iterator over the (key, value) items in odNr)r`rrrrÚ iteritemss zOrderedDict.iteritemscOsØt|ƒdkr tdt|ƒfƒ‚n |s,tdƒ‚|d}f}t|ƒdkrL|d}t|tƒrrx^|D]}||||<q\WnDt|dƒrœx8|jƒD]}||||<q†Wnx|D]\}}|||<q¢Wx|jƒD]\}}|||<qÀWdS)a—od.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)rTr¦rròÚhasattrrr)r“rr`ÚotherrYrZrrrr_s&      zOrderedDict.updatecCs0||kr||}||=|S||jkr,t|ƒ‚|S)z±od.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æ)r`rYrÏrÛrrrrý*s zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr)r`rYrÏrrrÚ setdefault7szOrderedDict.setdefaultc Cs^|si}t|ƒtƒf}||kr"dSd||<z&|s>d|jjfSd|jj|jƒfS||=XdS)zod.__repr__() <==> repr(od)z...rz%s()z%s(%r)N)rØÚ _get_identrör4r)r`Z _repr_runningZcall_keyrrrrñ>szOrderedDict.__repr__cs\‡fdd„ˆDƒ}tˆƒjƒ}xttƒƒD]}|j|dƒq*W|rPˆj|f|fSˆj|ffS)z%Return state information for picklingcsg|]}|ˆ|g‘qSrr)rrr)r`rrrvNsz*OrderedDict.__reduce__..N)Úvarsr÷rrýrö)r`rÚ inst_dictrr)r`rÚ __reduce__Ls zOrderedDict.__reduce__cCs |j|ƒS)z!od.copy() -> a shallow copy of od)rö)r`rrrr÷VszOrderedDict.copycCs |ƒ}x|D] }|||<q W|S)zˆOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rôrõrZÚdrYrrrróZs  zOrderedDict.fromkeyscCs6t|tƒr*t|ƒt|ƒko(|jƒ|jƒkStj||ƒS)z›od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrTrròÚ__eq__)r`r rrrr(es  zOrderedDict.__eq__cCs ||k S)Nr)r`r rrrÚ__ne__nszOrderedDict.__ne__cCst|ƒS)z@od.viewkeys() -> a set-like object providing a view on od's keys)r )r`rrrÚviewkeyssszOrderedDict.viewkeyscCst|ƒS)z an object providing a view on od's values)r )r`rrrÚ viewvalueswszOrderedDict.viewvaluescCst|ƒS)zBod.viewitems() -> a set-like object providing a view on od's items)r )r`rrrÚ viewitems{szOrderedDict.viewitems)T)N)N)N)"r4r5r6rcrbròrúrûrírrþrürrrrrrr_rÚobjectr!rýr"rñr&r÷rÿrór(r)r*r+r,rrrrr‰s:         r)ÚBaseConfiguratorÚ valid_identz^[a-z_][a-z0-9_]*$cCstj|ƒ}|std|ƒ‚dS)Nz!Not a valid Python identifier: %rT)Ú IDENTIFIERr,rR)rrîrrrr/…s  r/c@s"eZdZdZdd„Zddd„ZdS)ÚConvertingDictz A converting dictionary wrapper.cCsJtj||ƒ}|jj|ƒ}||k rF|||<t|ƒtttfkrF||_||_ |S)N) ròréÚ configuratorÚconvertr§r1ÚConvertingListÚConvertingTupleÚparentrY)r`rYrZrÛrrrré˜s   zConvertingDict.__getitem__NcCsLtj|||ƒ}|jj|ƒ}||k rH|||<t|ƒtttfkrH||_||_ |S)N) ròrSr2r3r§r1r4r5r6rY)r`rYrÏrZrÛrrrrS¤s  zConvertingDict.get)N)r4r5r6rcrérSrrrrr1•s r1cCsDtj|||ƒ}|jj|ƒ}||k r@t|ƒtttfkr@||_||_ |S)N) ròrýr2r3r§r1r4r5r6rY)r`rYrÏrZrÛrrrrý°s  rýc@s"eZdZdZdd„Zd dd„ZdS) r4zA converting list wrapper.cCsJtj||ƒ}|jj|ƒ}||k rF|||<t|ƒtttfkrF||_||_ |S)N) rärér2r3r§r1r4r5r6rY)r`rYrZrÛrrrré¼s   zConvertingList.__getitem__rcCs<tj||ƒ}|jj|ƒ}||k r8t|ƒtttfkr8||_|S)N) rärýr2r3r§r1r4r5r6)r`ÚidxrZrÛrrrrýÈs   zConvertingList.popNéÿÿÿÿ)r8)r4r5r6rcrérýrrrrr4ºs r4c@seZdZdZdd„ZdS)r5zA converting tuple wrapper.cCsBtj||ƒ}|jj|ƒ}||k r>t|ƒtttfkr>||_||_ |S)N) Útuplerér2r3r§r1r4r5r6rY)r`rYrZrÛrrrréÓs   zConvertingTuple.__getitem__N)r4r5r6rcrérrrrr5Ñsr5c@sŒeZdZdZejdƒZejdƒZejdƒZejdƒZ ejdƒZ ddd œZ e e ƒZd d „Zd d „Zdd„Zdd„Zdd„Zdd„Zdd„ZdS)r.zQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$Ú ext_convertÚ cfg_convert)rsÚcfgcCst|ƒ|_||j_dS)N)r1Úconfigr2)r`r=rrrrbñs zBaseConfigurator.__init__c CsÄ|jdƒ}|jdƒ}y`|j|ƒ}xP|D]H}|d|7}yt||ƒ}Wq&tk rl|j|ƒt||ƒ}Yq&Xq&W|Stk r¾tjƒdd…\}}td||fƒ}|||_ |_ |‚YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r7rrNzCannot resolve %r: %s) r9rýÚimporterrárÎÚ ImportErrorr{r�rRÚ __cause__Ú __traceback__) r`rr‰ÚusedÚfoundrKÚeÚtbÚvrrrÚresolveõs"      zBaseConfigurator.resolvecCs |j|ƒS)z*Default converter for the ext:// protocol.)rG)r`rZrrrr: szBaseConfigurator.ext_convertc Cs|}|jj|ƒ}|dkr&td|ƒ‚nØ||jƒd…}|j|jƒd}x´|rü|jj|ƒ}|rp||jƒd}nd|jj|ƒ}|rÔ|jƒd}|jj|ƒs¢||}n2yt |ƒ}||}Wnt k rÒ||}YnX|rê||jƒd…}qJtd||fƒ‚qJW|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) Ú WORD_PATTERNr,rRÚendr=ÚgroupsÚ DOT_PATTERNÚ INDEX_PATTERNÚ DIGIT_PATTERNÚintr¦)r`rZÚrestrîr'r7Únrrrr;s2       zBaseConfigurator.cfg_convertcCsÌt|tƒ r&t|tƒr&t|ƒ}||_n¢t|tƒ rLt|tƒrLt|ƒ}||_n|t|tƒ rrt|tƒrrt|ƒ}||_nVt|tƒrÈ|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)rr1ròr2r4rär5r9Ú string_typesÚCONVERT_PATTERNr,Ú groupdictÚvalue_convertersrSrá)r`rZrîr'rQÚ converterrrrrr32s*     zBaseConfigurator.convertcsrˆjdƒ}t|ƒs|j|ƒ}ˆjddƒ}t‡fdd„ˆDƒƒ}|f|Ž}|rnx |jƒD]\}}t|||ƒqVW|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|ƒr|ˆ|f‘qSr)r/)rrr)r=rrrvUsz5BaseConfigurator.configure_custom..)rýržrGròrÚsetattr)r`r=rÚpropsrarÛr‰rZr)r=rÚconfigure_customNs    z!BaseConfigurator.configure_customcCst|tƒrt|ƒ}|S)z0Utility function which converts lists to tuples.)rrär9)r`rZrrrÚas_tuple\s zBaseConfigurator.as_tupleN)r4r5r6rcr*r+rSrHrKrLrMrUÚ staticmethodÚ __import__r>rbrGr:r;r3rYrZrrrrr.Ýs      "r.)r)rrÒ)r×)N)N)’Ú __future__rrer*r{Ússlr?Ú version_inforÚ basestringrRrr£ÚtypesrÚ file_typeÚ __builtin__ÚbuiltinsÚ ConfigParserÚ configparserZ _backportrrr r r r Úurllibr rrrrrrrÚurllib2rrrrrr r!r"r#r$ÚhttplibÚ xmlrpclibÚQueueÚqueuer%ÚhtmlentitydefsÚ raw_inputÚ itertoolsr&Úfilterr'r1r)r/ÚioÚstrr0Ú urllib.parseÚurllib.requestÚ urllib.errorÚ http.clientÚclientÚrequestÚ xmlrpc.clientÚ html.parserÚ html.entitiesÚentitiesÚinputr2r3rRrMr\r]r-rdÚF_OKÚX_OKÚzipfilerŠr‘rrŒZBaseZipExtFiler|r”r›ržÚ NameErrorÚcollections.abcrœr©r«rÎÚgetfilesystemencodingr¤r¥Útokenizer¬Úcodecsr­r®r+rÂrºÚhtmlr?ÚcgirÓÚ collectionsrÔrÕÚreprlibrÖrãÚimportlib.utilrÚimprÚthreadrÙr#Ú dummy_threadÚ_abcollr r r ròÚlogging.configr.r/ÚIr0r1rýrär4r9r5rrrrÚs,      $,      ,0        2+A              [   b w