%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/__pycache__/zipimport.cpython-38.pyc

U

na-x@sRdZddlZddlmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddgZej
Z
ejddZGdddeZiZee
ZdZd	Zd
ZGdddZe
dd
d
fe
ddd
fddfZddZddZddZddZdZdaddZ ddZ!dd Z"d!d"Z#ee#j$Z%d#d$Z&d%d&Z'd'd(Z(d)d*Z)d+d,Z*d-d.Z+Gd/d0d0Z,dS)1aPzipimport provides support for importing Python modules from Zip archives.

This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
  subclass of ImportError, so it can be caught as ImportError, too.
- _zip_directory_cache: a dict, mapping archive paths to zip directory
  info dicts, as used in zipimporter._files.

It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
N)_unpack_uint16_unpack_uint32ZipImportErrorzipimporterc@seZdZdS)rN)__name__
__module____qualname__r
r
%/usr/local/lib/python3.8/zipimport.pyr!ssPKic@sleZdZdZddZdddZdddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZdS)razipimporter(archivepath) -> zipimporter object

    Create a new zipimporter instance. 'archivepath' must be a path to
    a zipfile, or to a specific path inside a zipfile. For example, it can be
    '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
    valid directory inside the archive.

    'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
    archive.

    The 'archive' attribute of zipimporter objects contains the name of the
    zipfile targeted.
    c	Cs$t|tsddl}||}|s,td|dtr<|tt}g}zt	|}WnHt
tfk
rt|\}}||krtd|d|}|
|Yq@X|jd@dkrtd|dqq@zt|}Wn$tk
rt|}|t|<YnX||_||_tj|ddd|_|jr |jt7_dS)Nrzarchive path is emptypathznot a Zip fileii)
isinstancestrosfsdecoderalt_path_sepreplacepath_sep_bootstrap_external
_path_statOSError
ValueError_path_splitappendst_mode_zip_directory_cacheKeyError_read_directory_filesarchive
_path_joinprefix)selfrrr$stdirnamebasenamefilesr
r
r__init__?s:

zzipimporter.__init__NcCsNt||}|dk	r|gfSt||}t||rFd|jt|gfSdgfS)afind_loader(fullname, path=None) -> self, str or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, a string containing the
        full path name if it's possibly a portion of a namespace package,
        or None otherwise. The optional 'path' argument is ignored -- it's
        there for compatibility with the importer protocol.
        N)_get_module_info_get_module_path_is_dirr"r)r%fullnamermimodpathr
r
rfind_loaderms



zzipimporter.find_loadercCs|||dS)afind_module(fullname, path=None) -> self or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, or None if it wasn't.
        The optional 'path' argument is ignored -- it's there for compatibility
        with the importer protocol.
        r)r1)r%r.rr
r
rfind_modules	zzipimporter.find_modulecCst||\}}}|S)zget_code(fullname) -> code object.

        Return the code object for the specified module. Raise ZipImportError
        if the module couldn't be found.
        _get_module_coder%r.code	ispackager0r
r
rget_codeszzipimporter.get_codecCsvtr|tt}|}||jtr:|t|jtd}z|j|}Wn tk
rhtdd|YnXt	|j|S)zget_data(pathname) -> string with file data.

        Return the data associated with 'pathname'. Raise OSError if
        the file wasn't found.
        Nr)
rrr
startswithr"lenr!rr	_get_data)r%pathnamekey	toc_entryr
r
rget_dataszzipimporter.get_datacCst||\}}}|S)zjget_filename(fullname) -> filename string.

        Return the filename for the specified module.
        r3r5r
r
rget_filenameszzipimporter.get_filenamecCst||}|dkr$td||dt||}|r@t|d}n
|d}z|j|}Wntk
rnYdSXt|j|	S)zget_source(fullname) -> source string.

        Return the source code for the specified module. Raise ZipImportError
        if the module couldn't be found, return None if the archive does
        contain the module, but has no source for it.
        Ncan't find module name__init__.py.py)
r+rr,rr#r!rr<r"decode)r%r.r/rfullpathr?r
r
r
get_sources


zzipimporter.get_sourcecCs(t||}|dkr$td||d|S)zis_package(fullname) -> bool.

        Return True if the module specified by fullname is a package.
        Raise ZipImportError if the module couldn't be found.
        NrBrC)r+r)r%r.r/r
r
r
is_packages
zzipimporter.is_packagecCst||\}}}tj|}|dks.t|ts@t|}|tj|<||_zT|rlt||}t	|j
|}|g|_t|ds|t
|_
t|j||t||jWntj|=YnXztj|}Wn$tk
rtd|dYnXtd|||S)zload_module(fullname) -> module.

        Load the module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the imported
        module, or raises ZipImportError if it wasn't found.
        N__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r4sysmodulesgetr_module_type
__loader__r,rr#r"__path__hasattrrK_fix_up_module__dict__execrImportError
_bootstrap_verbose_message)r%r.r6r7r0modrrHr
r
rload_modules0


zzipimporter.load_modulecCsXz||sWdSWntk
r*YdSXtjsNddlm}|tdt_t||S)zReturn the ResourceReader for a package in a zip file.

        If 'fullname' is a package within the zip file, return the
        'ResourceReader' object for the package.  Otherwise return None.
        Nr)ResourceReaderT)rJr_ZipImportResourceReader_registered
importlib.abcr[register)r%r.r[r
r
rget_resource_readers


zzipimporter.get_resource_readercCsd|jt|jdS)Nz<zipimporter object "z">)r"rr$)r%r
r
r__repr__"szzipimporter.__repr__)N)N)rrr	__doc__r*r1r2r8r@rArIrJrZr`rar
r
r
rr-s.
 


&z__init__.pycTrEF)z.pycTF)rFFFcCs|j|ddS)N.)r$
rpartition)r%r.r
r
rr,4sr,cCs|t}||jkSN)rr!)r%rdirpathr
r
rr-8sr-cCs8t||}tD]$\}}}||}||jkr|SqdSrf)r,_zip_searchorderr!)r%r.rsuffix
isbytecoder7rHr
r
rr+As


r+c	Cszt|}Wn&tk
r4td||dYnX|z$|td|}|t}Wn&tk
rtd||dYnXt|tkrtd||d|ddt	krz|dd|}Wn&tk
rtd||dYnXt
|ttd}z|||}Wn(tk
rJtd||dYnX|t	}|dkrrtd||d|||t}t|tkrtd||d|t||}t
|d	d
}t
|d
d}	||krtd||d||	kr
td
||d||8}||	}
|
dkr6td||di}d}z||Wn(tk
rttd||dYnX|d}t|dkrtd|dddkrqt|dkrtdt|dd}
t|dd	}t|d	d}t|dd
}t
|d
d}t
|dd}t
|dd}t|dd}t|dd}t|dd}t
|dd}|||}||	krtd||d||
7}z||}Wn(tk
rtd||dYnXt||krtd||dz2t|||||kr*td||dWn(tk
rTtd||dYnX|
d@rj|}n6z|d}Wn&tk
r|dt}YnX|dt}t||}||||||||f}|||<|d 7}qvW5QRXtd!|||S)"Nzcan't open Zip file: r
rdcan't read Zip file: rznot a Zip file: zcorrupt Zip file: zbad central directory size: zbad central directory offset: z&bad central directory size or offset: .EOF read where not expectedsPK
 "*zbad local header offset: iasciilatin1/rz!zipimport: found {} names in {!r})_io	open_coderrseekEND_CENTRAL_DIR_SIZEtellreadr;STRING_END_ARCHIVEmaxMAX_COMMENT_LENrfindrEOFErrorrrGUnicodeDecodeError	translatecp437_tablerrrr#rWrX)r"fpheader_positionbuffer	file_sizemax_comment_startdataposheader_size
header_offset
arc_offsetr)countflagscompresstimedatecrc	data_size	name_size
extra_sizecomment_sizefile_offsetrDrtr
r
rr `s













r u	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsltrtdtddaz<zddlm}Wn&tk
rRtdtdYnXW5daXtd|S)Nzzipimport: zlib UNAVAILABLE)can't decompress data; zlib not availableTFr
decompresszzipimport: zlib available)_importing_zlibrWrXrzlibr	Exceptionrr
r
r_get_decompress_funcs


rc	Cs|\}}}}}}}}	|dkr$tdt|}
z|
|Wn&tk
rftd||dYnX|
d}t|dkrtd|dddkrtd	||dt|d
d}t|dd}
d||
}||7}z|
|Wn(tk
rtd||dYnX|
|}t||kr4tdW5QRX|dkrL|Sz
t	}Wnt
k
rttd
YnX||dS)Nrznegative data sizerkr
rwrqrlsPKzbad local file header: rvzzipimport: can't read datari)rr~rrrrr;rrrr)r"r?datapathrrrrrrrrrrrrraw_datarr
r
rr<s>



r<cCst||dkS)Nr)abs)t1t2r
r
r	_eq_mtimeAsrcCs<||d}zt|||}Wntk
r2YdSX|d@dk}|r|d@dk}tjdkr|shtjdkrt||}	|	dk	rttj|	}
zt||
||Wntk
rYdSXnTt	||\}}|r
t
t|dd|rt|dd	|kr
t
d
|dSt|d	d}
t|
ts8td|d|
S)
N)rDrrrrdneveralwaysrrrmrnzbytecode is stale for zcompiled module z is not a code object)r
_classify_pycrV_impcheck_hash_based_pycs_get_pyc_sourcesource_hash_RAW_MAGIC_NUMBER_validate_hash_pyc_get_mtime_and_size_of_sourcerrrWrXmarshalloadsr
_code_type	TypeError)r%r=rHr.rexc_detailsr
hash_basedcheck_sourcesource_bytesrsource_mtimesource_sizer6r
r
r_unmarshal_codeKsX


rcCs|dd}|dd}|S)Ns


)r)sourcer
r
r_normalize_line_endings~srcCst|}t||dddS)NrUT)dont_inherit)rcompile)r=rr
r
r_compile_sourcesrcCsDt|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	S)
N	i?rdr)rmktime)drr
r
r_parse_dostimes



rc
CstzR|dddkst|dd}|j|}|d}|d}|d}t|||fWStttfk
rnYdSXdS)Nrcor)rr)AssertionErrorr!rr
IndexErrorr)r%rr?rruncompressed_sizer
r
rrs
rcCsV|dddkst|dd}z|j|}Wntk
rDYdSXt|j|SdS)Nrr)rr!rr<r")r%rr?r
r
rrsrc	Cst||}tD]\}}}||}tjd|jt|ddz|j|}Wntk
rXYqX|d}t|j|}	|rt	|||||	}
n
t
||	}
|
dkrq|d}|
||fSqtd||ddS)Nz
trying {}{}{}rd)	verbosityrrBrC)r,rhrWrXr"rr!rr<rrr)r%r.rrirjr7rHr?r0rr6r
r
rr4s$

r4c@s<eZdZdZdZddZddZddZd	d
ZddZ	d
S)r\zPrivate class used to support ZipImport.get_resource_reader().

    This class is allowed to reference all the innards and private parts of
    the zipimporter.
    FcCs||_||_dSrf)rr.)r%rr.r
r
rr*sz!_ZipImportResourceReader.__init__cCs\|jdd}|d|}ddlm}z||j|WStk
rVt|YnXdS)Nrcr}r)BytesIO)r.riorrr@rFileNotFoundError)r%resourcefullname_as_pathrrr
r
r
open_resourcesz&_ZipImportResourceReader.open_resourcecCstdSrf)r)r%rr
r
r
resource_pathsz&_ZipImportResourceReader.resource_pathcCsH|jdd}|d|}z|j|Wntk
rBYdSXdS)Nrcr}FT)r.rrr@r)r%rDrrr
r
ris_resourcesz$_ZipImportResourceReader.is_resourcec		csddlm}||j|j}||jj}|jdks:t|j	}t
}|jjD]f}z|||}Wntk
r|YqNYnX|j	j}t
|dkr|jVqN||krN|||VqNdS)Nr)PathrE)pathlibrrrAr.relative_tor"rDrparentsetr!rr;add)	r%r
fullname_path
relative_pathpackage_pathsubdirs_seenfilenamerelativeparent_namer
r
rcontentss"


z!_ZipImportResourceReader.contentsN)
rrr	rbr]r*rrrrr
r
r
rr\s	r\)-rb_frozen_importlib_externalrrr_frozen_importlibrWrr~rrLr__all__rpath_separatorsrrVrrtyperOrrrrrhr,r-r+r rrrr<rr__code__rrrrrrr4r\r
r
r
r<module>sX		~.
.



Zerion Mini Shell 1.0