Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ÝPfaŸã‡@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@mZmZmZm„Zod?d@„ZiYnXyddAlpmqZqWn"ek �r ddAlrmqZqYnXejddB…ddk�r,e3ƒjsZsn ddDlpmsZsyddEl`mtZtWndek �r¬ddFl`muZuyddGlvmwZxWn ek �r–dedIdJ„ZxYnXGdKdL„dLeuƒZtYnXyddMlymzZzWn ek �rÞdfdNdO„ZzYnXyddPl`m{Z{WnŠek �rzyddQl|m}Z~Wn"ek �r4ddQlm}Z~YnXyddRl€m�Z�m‚Z‚mƒZƒWnek �rdYnXGdSdT„dTe„ƒZ{YnXyddUl…m†Z†m‡Z‡Wnvek �rejmdVejˆƒZ‰dWdX„Z‡GdYdZ„dZe„ƒZŠdgd[d\„Z‹Gd]d^„d^eŒƒZ�Gd_d`„d`eŽƒZ�Gdadb„dbeQƒZ†YnXdS)hé)Ú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ú/usr/lib/python3.6/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,) ZdnÚhostnameZ max_wildcardsZpatsÚpartsZleftmostZ remainderZ wildcardsÚfragZpatrrrÚ_dnsname_matchbs(    rFcCsò|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_REQUIREDZsubjectAltNameZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) Ú ValueErrorÚgetrFr=Úlenr3rAÚmapr;)ZcertrCZdnsnamesZsanÚ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__rTrrrrrOÂsrO)Ú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ÚPATHZwin32rZPATHEXTÚc3s |]}ˆjƒj|jƒƒVqdS)N)r<Úendswith)Ú.0Úext)Úcmdrrú øszwhich..csg|] }ˆ|‘qSrr)rbrc)rdrrú ûszwhich..)rWrXÚdirnameÚenvironrHÚdefpathr9ÚpathsepÚsysÚplatformÚcurdirÚinsertÚanyÚsetÚnormcaseÚaddrA) rdr]rXr^ZpathextÚfilesÚseenÚdirZnormdirZthefileÚnamer)rdrrVÎs8            rV)ÚZipFileÚ __enter__)Ú ZipExtFilec@s$eZdZdd„Zdd„Zdd„ZdS)rycCs|jj|jƒdS)N)rPrQ)rRÚbaserrrrTszZipExtFile.__init__cCs|S)Nr)rRrrrrxszZipExtFile.__enter__cGs |jƒdS)N)Úclose)rRÚexc_inforrrÚ__exit__szZipExtFile.__exit__N)r4r5r6rTrxr}rrrrrysryc@s$eZdZdd„Zdd„Zdd„ZdS)rwcCs|S)Nr)rRrrrrx"szZipFile.__enter__cGs |jƒdS)N)r{)rRr|rrrr}%szZipFile.__exit__cOstj|f|ž|Ž}t|ƒS)N)Ú BaseZipFileÚopenry)rRÚargsrSrzrrrr)sz ZipFile.openN)r4r5r6rxr}rrrrrrw!srw)Úpython_implementationcCs0dtjkrdStjdkrdStjjdƒr,dSdS)z6Return a string identifying the Python implementation.ZPyPyÚjavaZJythonZ IronPythonZCPython)rkÚversionrWrvr>rrrrr�0s   r�)Ú sysconfig)ÚCallablecCs t|tƒS)N)rr…)ÚobjrrrÚcallableDsr‡Ú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ÚfsencodeRs    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Úfsdecode[s    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_namels 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—Ú LookupErrorrv)ÚlineÚ line_stringÚmsgZmatchesÚencodingÚcodec)Ú bom_foundr‘rrÚ find_cookie•s6       z$detect_encoding..find_cookieTrz utf-8-sig)Ú__self__rvÚAttributeErrorr>r–)r¦r±Údefaultr§r´ÚfirstÚsecondr)r³r‘r¦rr•ws4   &     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_identrrÚdiscard)rRrKÚresult)Ú fillvalueÚ repr_runningÚ user_functionrrÚwrapperìs   z=_recursive_repr..decorating_function..wrapperr5rUr4Ú__annotations__)rpÚgetattrr5rUr4rÈ)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)rRrÍrrrrT szChainMap.__init__cCs t|ƒ‚dS)N)ÚKeyError)rRrKrrrÚ __missing__szChainMap.__missing__c Cs8x,|jD]"}y||Stk r(YqXqW|j|ƒS)N)rÍrÎrÏ)rRrKÚmappingrrrÚ __getitem__s   zChainMap.__getitem__NcCs||kr||S|S)Nr)rRrKr·rrrrHsz ChainMap.getcCsttƒj|jŽƒS)N)rIrpÚunionrÍ)rRrrrÚ__len__"szChainMap.__len__cCsttƒj|jŽƒS)N)ÚiterrprÒrÍ)rRrrrÚ__iter__%szChainMap.__iter__cst‡fdd„|jDƒƒS)Nc3s|]}ˆ|kVqdS)Nr)rbÚm)rKrrre)sz(ChainMap.__contains__..)rorÍ)rRrKr)rKrÚ __contains__(szChainMap.__contains__cCs t|jƒS)N)rorÍ)rRrrrÚ__bool__+szChainMap.__bool__cCsdj|djtt|jƒƒƒS)Nz{0.__class__.__name__}({1})z, )r©rArJr;rÍ)rRrrrÚ__repr__.szChainMap.__repr__cGs|tj|f|žŽƒS)z?Create a ChainMap with a single dict created from the iterable.)ÚdictÚfromkeys)ÚclsÚiterabler€rrrrÛ3szChainMap.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)rRrrrrß8sz ChainMap.copycCs|jif|jžŽS)z;New ChainMap with a new dict followed by all previous maps.)rÞrÍ)rRrrrÚ new_child>szChainMap.new_childcCs|j|jdd…ŽS)zNew ChainMap from maps[1:].rN)rÞrÍ)rRrrrÚparentsBszChainMap.parentscCs||jd|<dS)Nr)rÍ)rRrKrLrrrÚ __setitem__GszChainMap.__setitem__c Cs8y|jd|=Wn"tk r2tdj|ƒƒ‚YnXdS)Nrz(Key not found in the first mapping: {!r})rÍrÎr©)rRrKrrrÚ __delitem__JszChainMap.__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Î)rRrrrräPszChainMap.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©)rRrKr€rrrråWsz ChainMap.popcCs|jdjƒdS)z'Clear maps[0], leaving maps[1:] intact.rN)rÍÚclear)rRrrrræ^szChainMap.clear)N)r4r5r6rUrTrÏrÑrHrÓrÕr×rØrËrÙÚ classmethodrÛrßÚ__copy__ràÚpropertyrárârãrärårærrrrr¼s(    r¼)Úcache_from_sourcecCs"|dkr d}|rd}nd}||S)NFÚcÚor)rXÚdebug_overrideÚsuffixrrrrêes rê)Ú 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):rïz)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)rIr�Ú_OrderedDict__rootr¶Ú_OrderedDict__mapÚ_OrderedDict__update)rRr€ÚkwdsÚrootrrrrTŒs    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||ƒdS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rórô)rRrKrLZ dict_setitemr÷Úlastrrrrâœs  zOrderedDict.__setitem__cCs0|||ƒ|jj|ƒ\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rôrå)rRrKZ 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ó)rRr÷ÚcurrrrrrÕ¯s   zOrderedDict.__iter__ccs2|j}|d}x||k r,|dV|d}qWdS)z#od.__reversed__() <==> reversed(od)rr(N)ró)rRr÷rûrrrÚ __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Ú)rRZnoder÷rrrræ¿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å)rRrør÷ÚlinkrùrúrKrLrrrräËs   zOrderedDict.popitemcCst|ƒS)zod.keys() -> list of keys in od)rÌ)rRrrrÚkeysäszOrderedDict.keyscs‡fdd„ˆDƒS)z#od.values() -> list of values in odcsg|] }ˆ|‘qSrr)rbrK)rRrrrfêsz&OrderedDict.values..r)rRr)rRrÚvaluesèszOrderedDict.valuescs‡fdd„ˆDƒS)z.od.items() -> list of (key, value) pairs in odcsg|]}|ˆ|f‘qSrr)rbrK)rRrrrfîsz%OrderedDict.items..r)rRr)rRrÚitemsìszOrderedDict.itemscCst|ƒS)z0od.iterkeys() -> an iterator over the keys in od)rÔ)rRrrrÚiterkeysðszOrderedDict.iterkeysccsx|D]}||VqWdS)z2od.itervalues -> an iterator over the values in odNr)rRÚkrrrrýôs zOrderedDict.itervaluesccs x|D]}|||fVqWdS)z=od.iteritems -> an iterator over the (key, value) items in odNr)rRrrrrÚ iteritemsùs 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)rrrÿN)rIr�rrÚÚhasattrrÿr)r€rörRÚotherrKrLrrrrQþ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Î)rRrKr·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)rRrKr·rrrÚ setdefault.szOrderedDict.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)rRZ _repr_runningZcall_keyrrrrÙ5szOrderedDict.__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)rbr)rRrrrfEsz*OrderedDict.__reduce__..N)ÚvarsrßrïrårÞ)rRrZ inst_dictrr)rRrÚ __reduce__Cs zOrderedDict.__reduce__cCs |j|ƒS)z!od.copy() -> a shallow copy of od)rÞ)rRrrrrßMszOrderedDict.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ÝrLÚdrKrrrrÛQs  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. )rrïrIrrÚÚ__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ð)rRrrrÚviewkeysjszOrderedDict.viewkeyscCst|ƒS)z 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)"r4r5r6rUrTrÚrârãrÕrürærärÿrrrrýrrQrõÚobjectrrårrÙr rßrçrÛr rrrrrrrrrï€s:         rï)ÚBaseConfiguratorÚ valid_identz^[a-z_][a-z0-9_]*$cCstj|ƒ}|std|ƒ‚dS)Nz!Not a valid Python identifier: %rT)Ú IDENTIFIERr,rG)rrÖrrrr|s  rc@s"eZdZdZdd„Zddd„ZdS)ÚConvertingDictz A converting dictionary wrapper.cCsJtj||ƒ}|jj|ƒ}||k rF|||<t|ƒtttfkrF||_||_ |S)N) rÚrÑÚ configuratorÚconvertr�rÚConvertingListÚConvertingTupleÚparentrK)rRrKrLrÃrrrrÑ�s   zConvertingDict.__getitem__NcCsLtj|||ƒ}|jj|ƒ}||k rH|||<t|ƒtttfkrH||_||_ |S)N) rÚrHrrr�rrrrrK)rRrKr·rLrÃrrrrH›s  zConvertingDict.get)N)r4r5r6rUrÑrHrrrrrŒs rcCsDtj|||ƒ}|jj|ƒ}||k r@t|ƒtttfkr@||_||_ |S)N) rÚrårrr�rrrrrK)rRrKr·rLrÃrrrrå§s  råc@s"eZdZdZdd„Zd dd„ZdS) rzA converting list wrapper.cCsJtj||ƒ}|jj|ƒ}||k rF|||<t|ƒtttfkrF||_||_ |S)N) rÌrÑrrr�rrrrrK)rRrKrLrÃrrrrѳs   zConvertingList.__getitem__rcCs<tj||ƒ}|jj|ƒ}||k r8t|ƒtttfkr8||_|S)N) rÌrårrr�rrrr)rRÚidxrLrÃrrrrå¿s   zConvertingList.popNéÿÿÿÿ)r)r4r5r6rUrÑrårrrrr±s rc@seZdZdZdd„ZdS)rzA converting tuple wrapper.cCsBtj||ƒ}|jj|ƒ}||k r>t|ƒtttfkr>||_||_ |S)N) ÚtuplerÑrrr�rrrrrK)rRrKrLrÃrrrrÑÊs   zConvertingTuple.__getitem__N)r4r5r6rUrÑrrrrrÈsrc@sŒeZdZdZejdƒZejdƒZejdƒZejdƒZ ejdƒZ ddd œZ e e ƒZd d „Zd d „Zdd„Zdd„Zdd„Zdd„Zdd„ZdS)rzQ 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)rcZcfgcCst|ƒ|_||j_dS)N)rÚconfigr)rRr!rrrrTè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¶Ú ImportErrorrkr|rGÚ __cause__Ú __traceback__) rRrrvZusedÚfoundrEÚeÚtbÚvrrrÚresolveìs"      zBaseConfigurator.resolvecCs |j|ƒS)z*Default converter for the ext:// protocol.)r*)rRrLrrrrszBaseConfigurator.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,rGÚendr!ÚgroupsÚ DOT_PATTERNÚ INDEX_PATTERNÚ DIGIT_PATTERNÚintr�)rRrLÚrestrÖr rÚ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î)rrrÚrrrÌrrÚ string_typesÚCONVERT_PATTERNr,Ú groupdictÚvalue_convertersrHrÉ)rRrLrÖr r4Z converterrîrrrr)s*     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)rbr)r!rrrfLsz5BaseConfigurator.configure_custom..)rår‡r*rÚrÚsetattr)rRr!rëZpropsrSrÃrvrLr)r!rÚconfigure_customEs    z!BaseConfigurator.configure_customcCst|tƒrt|ƒ}|S)z0Utility function which converts lists to tuples.)rrÌr)rRrLrrrÚas_tupleSs zBaseConfigurator.as_tupleN)r4r5r6rUr*r+r6r+r.r/r0r8Ú staticmethodÚ __import__r"rTr*rr rr:r;rrrrrÔs      "r)r)rrº)r¿)N)N)�Z __future__rrWr*rkZsslr#Ú version_inforZ basestringr5rrŒÚtypesrZ file_typeZ __builtin__ÚbuiltinsZ ConfigParserZ configparserZ _backportrrr r r r Zurllibr rrrrrrrZurllib2rrrrrr r!r"r#r$ZhttplibZ xmlrpclibZQueueZqueuer%ZhtmlentitydefsZ raw_inputÚ itertoolsr&Úfilterr'r1r)r/ÚioÚstrr0Z urllib.parseZurllib.requestZ urllib.errorZ http.clientZclientZrequestZ xmlrpc.clientZ html.parserZ html.entitiesZentitiesÚinputr2r3rGrFrNrOrrVÚF_OKÚX_OKZzipfilerwr~rryZBaseZipExtFilerlr�r„r‡Ú NameErrorÚ collectionsr…r’r”r¶Úgetfilesystemencodingr�rŽÚtokenizer•Úcodecsr–r—r+r«r£Zhtmlr?Zcgir»r¼r½Úreprlibr¾rËZimprêrïZthreadrÁr Z dummy_threadZ_abcollrðrñròrÚZlogging.configrrÚIrrrårÌrrrrrrrÚs&      $,      ,0        2+A              [   b w