Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ÝPf*ã@sˆddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZejeƒZdaGdd„deƒZGdd „d eƒZGd d „d eƒZGd d „d eƒZGdd„deƒZGdd„deƒZedƒee jeiZyFy ddl Z!Wne"k �r$ddl#Z!YnXeee!j$<eee!j%<[!Wne"e&fk �rXYnXdd„Z'iZ(dd„Z)e j*e+dƒƒZ,dd„Z-dS)é)Úunicode_literalsNé)ÚDistlibException)Úcached_propertyÚget_cache_baseÚpath_to_cache_dirÚCachecs.eZdZd‡fdd„ Zdd„Zdd„Z‡ZS) Ú ResourceCacheNcs0|dkrtjjtƒtdƒƒ}tt|ƒj|ƒdS)Nzresource-cache)ÚosÚpathÚjoinrÚstrÚsuperr Ú__init__)ÚselfÚbase)Ú __class__©ú/usr/lib/python3.6/resources.pyrszResourceCache.__init__cCsdS)zã Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Tr)rÚresourcer rrrÚis_stale#s zResourceCache.is_stalec Cs |jj|ƒ\}}|dkr|}n~tjj|j|j|ƒ|ƒ}tjj|ƒ}tjj|ƒsXtj |ƒtjj |ƒsjd}n |j ||ƒ}|rœt |dƒ�}|j |jƒWdQRX|S)z¤ Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTÚwb)ÚfinderÚget_cache_infor r r rZ prefix_to_dirÚdirnameÚisdirÚmakedirsÚexistsrÚopenÚwriteÚbytes)rrÚprefixr ÚresultrZstaleÚfrrrÚget.s      zResourceCache.get)N)Ú__name__Ú __module__Ú __qualname__rrr$Ú __classcell__rr)rrr s r c@seZdZdd„ZdS)Ú ResourceBasecCs||_||_dS)N)rÚname)rrr*rrrrIszResourceBase.__init__N)r%r&r'rrrrrr)Hsr)c@s@eZdZdZdZdd„Zedd„ƒZedd„ƒZed d „ƒZ d S) ÚResourcezÇ A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |jj|ƒS)z’ Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )rÚ get_stream)rrrrÚ as_streamVszResource.as_streamcCstdkrtƒatj|ƒS)N)Úcacher r$)rrrrÚ file_path_szResource.file_pathcCs |jj|ƒS)N)rÚ get_bytes)rrrrr fszResource.bytescCs |jj|ƒS)N)rÚget_size)rrrrÚsizejsz Resource.sizeN) r%r&r'Ú__doc__Ú is_containerr-rr/r r2rrrrr+Ns   r+c@seZdZdZedd„ƒZdS)ÚResourceContainerTcCs |jj|ƒS)N)rÚ get_resources)rrrrÚ resourcesrszResourceContainer.resourcesN)r%r&r'r4rr7rrrrr5osr5c@s’eZdZdZejjdƒrdZnd Zdd„Zdd „Z d d „Z d d „Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„ZeejjƒZdd„ZdS)!ÚResourceFinderz4 Resource finder for file system resources. Újavaú.pycú.pyoú.classcCs.||_t|ddƒ|_tjjt|ddƒƒ|_dS)NÚ __loader__Ú__file__Ú)ÚmoduleÚgetattrÚloaderr r rr)rr@rrrr�szResourceFinder.__init__cCs tjj|ƒS)N)r r Úrealpath)rr rrrÚ _adjust_path†szResourceFinder._adjust_pathcCsBt|tƒrd}nd}|j|ƒ}|jd|jƒtjj|Ž}|j|ƒS)Nó/ú/r) Ú isinstancer ÚsplitÚinsertrr r r rD)rÚ resource_nameÚsepÚpartsr"rrrÚ _make_path‰s   zResourceFinder._make_pathcCs tjj|ƒS)N)r r r)rr rrrÚ_find•szResourceFinder._findcCs d|jfS)N)r )rrrrrr˜szResourceFinder.get_cache_infocCsD|j|ƒ}|j|ƒsd}n&|j|ƒr0t||ƒ}n t||ƒ}||_|S)N)rMrNÚ _is_directoryr5r+r )rrJr r"rrrÚfind›s     zResourceFinder.findcCs t|jdƒS)NÚrb)rr )rrrrrr,§szResourceFinder.get_streamc Cs t|jdƒ� }|jƒSQRXdS)NrQ)rr Úread)rrr#rrrr0ªszResourceFinder.get_bytescCstjj|jƒS)N)r r Úgetsize)rrrrrr1®szResourceFinder.get_sizecs*‡fdd„‰t‡fdd„tj|jƒDƒƒS)Ncs|dko|jˆjƒ S)NÚ __pycache__)ÚendswithÚskipped_extensions)r#)rrrÚallowed²sz-ResourceFinder.get_resources..allowedcsg|]}ˆ|ƒr|‘qSrr)Ú.0r#)rWrrú µsz0ResourceFinder.get_resources..)Úsetr Úlistdirr )rrr)rWrrr6±s zResourceFinder.get_resourcescCs |j|jƒS)N)rOr )rrrrrr4·szResourceFinder.is_containerccsŒ|j|ƒ}|dk rˆ|g}xn|r†|jdƒ}|V|jr|j}xH|jD]>}|sP|}ndj||gƒ}|j|ƒ}|jrz|j|ƒqB|VqBWqWdS)NrrF)rPÚpopr4r*r7r Úappend)rrJrZtodoZrnamer*Únew_nameZchildrrrÚiterator¼s      zResourceFinder.iteratorN)r:r;r<)r:r;)r%r&r'r3ÚsysÚplatformÚ startswithrVrrDrMrNrrPr,r0r1r6r4Ú staticmethodr r rrOr_rrrrr8ws"    r8cs`eZdZdZ‡fdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dd„Z ‡Z S)ÚZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|ƒj|ƒ|jj}dt|ƒ|_t|jdƒr>|jj|_n t j ||_t |jƒ|_ dS)NrÚ_files) rrdrrBÚarchiveÚlenÚ prefix_lenÚhasattrreÚ zipimportÚ_zip_directory_cacheÚsortedÚindex)rr@rf)rrrrÕs   zZipResourceFinder.__init__cCs|S)Nr)rr rrrrDàszZipResourceFinder._adjust_pathc Cs¤||jd…}||jkrd}nX|r:|dtjkr:|tj}tj|j|ƒ}y|j|j|ƒ}Wntk rtd}YnX|sŽtj d||j j ƒntj d||j j ƒ|S)NTrFz_find failed: %r %rz_find worked: %r %réÿÿÿÿ) rhrer rKÚbisectrmrbÚ IndexErrorÚloggerÚdebugrBr!)rr r"ÚirrrrNãs   zZipResourceFinder._findcCs&|jj}|jdt|ƒd…}||fS)Nr)rBrfr rg)rrr!r rrrrõsz ZipResourceFinder.get_cache_infocCs|jj|jƒS)N)rBÚget_datar )rrrrrr0úszZipResourceFinder.get_bytescCstj|j|ƒƒS)N)ÚioÚBytesIOr0)rrrrrr,ýszZipResourceFinder.get_streamcCs|j|jd…}|j|dS)Né)r rhre)rrr rrrr1szZipResourceFinder.get_sizecCs¤|j|jd…}|r,|dtjkr,|tj7}t|ƒ}tƒ}tj|j|ƒ}xV|t|jƒkrž|j|j|ƒsjP|j||d…}|j |j tjdƒdƒ|d7}qJW|S)Nrrrn) r rhr rKrgrZrormrbÚaddrH)rrr Zplenr"rsÚsrrrr6s  zZipResourceFinder.get_resourcesc Csj||jd…}|r*|dtjkr*|tj7}tj|j|ƒ}y|j|j|ƒ}Wntk rdd}YnX|S)NrFrn)rhr rKrormrbrp)rr rsr"rrrrOs  zZipResourceFinder._is_directory)r%r&r'r3rrDrNrr0r,r1r6rOr(rr)rrrdÑs rdcCs|tt|ƒ<dS)N)Ú_finder_registryÚtype)rBÚ finder_makerrrrÚregister_finder0sr}cCsŒ|tkrt|}nv|tjkr$t|ƒtj|}t|ddƒ}|dkrJtdƒ‚t|ddƒ}tjt|ƒƒ}|dkrxtd|ƒ‚||ƒ}|t|<|S)zŸ Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. Ú__path__Nz8You cannot get a finder for a module, only for a packager=zUnable to locate finder for %r) Ú _finder_cacher`ÚmodulesÚ __import__rArrzr$r{)Úpackager"r@r rBr|rrrr6s      rZ __dummy__cCsRd}tj|ƒtjj|ƒ}tjt|ƒƒ}|rNt}tj j |dƒ|_ ||_ ||ƒ}|S)z¬ Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. Nr?) ÚpkgutilZ get_importerr`Úpath_importer_cacher$rzr{Ú _dummy_moduler r r r>r=)r r"rBrr@rrrÚfinder_for_pathRs  r†).Z __future__rroruZloggingr rƒZshutilr`Útypesrjr?rÚutilrrrrZ getLoggerr%rqr.r Úobjectr)r+r5r8rdr{Ú zipimporterrzÚ_frozen_importlib_externalZ_fiÚ ImportErrorÚ_frozen_importlibÚSourceFileLoaderÚ FileFinderÚAttributeErrorr}rrÚ ModuleTyper r…r†rrrrÚsH   ,!ZN