HiveNetCore.utils.myzipfile module¶
Read and write ZIP files.
- HiveNetCore.utils.myzipfile.BadZipfile¶
BadZipFile的别名
- exception HiveNetCore.utils.myzipfile.LargeZipFile[源代码]¶
基类:
ExceptionRaised when writing a zipfile, the zipfile requires ZIP64 extensions and those extensions are disabled.
- class HiveNetCore.utils.myzipfile.PyZipFile(file, mode='r', compression=0, allowZip64=True, optimize=- 1)[源代码]¶
基类:
ZipFileClass to create ZIP archives with Python library files and packages.
- class HiveNetCore.utils.myzipfile.ZipFile(file, mode='r', compression=0, allowZip64=True, compresslevel=None)[源代码]¶
基类:
objectClass with methods to open, read, write, close, list zip files.
- __init__(file, mode='r', compression=0, allowZip64=True, compresslevel=None)[源代码]¶
Open the ZIP file with mode read ‘r’, write ‘w’, exclusive create ‘x’,
or append ‘a’.
- property comment¶
The comment text associated with the ZIP file.
- extract(member, path=None, pwd=None)[源代码]¶
Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately as possible. `member’ may be a filename or a ZipInfo object. You can specify a different directory using `path’.
- extractall(path=None, members=None, pwd=None)[源代码]¶
Extract all members from the archive to the current working
directory. `path’ specifies a different directory to extract to. `members’ is optional and must be a subset of the list returned by namelist().
- fp = None¶
- write(filename, arcname=None, compress_type=None, compresslevel=None)[源代码]¶
Put the bytes from filename into the archive under the name
arcname.
- writestr(zinfo_or_arcname, data, compress_type=None, compresslevel=None)[源代码]¶
Write a file into the archive. The contents is ‘data’, which
may be either a ‘str’ or a ‘bytes’ instance; if it is a ‘str’, it is encoded as UTF-8 first. ‘zinfo_or_arcname’ is either a ZipInfo instance or the name of the file in the archive.
- class HiveNetCore.utils.myzipfile.ZipInfo(filename='NoName', date_time=(1980, 1, 1, 0, 0, 0))[源代码]¶
基类:
objectClass with attributes describing each file in the ZIP archive.
- CRC¶
- comment¶
- compress_size¶
- compress_type¶
- create_system¶
- create_version¶
- date_time¶
- external_attr¶
- extra¶
- extract_version¶
- file_size¶
- filename¶
- flag_bits¶
- classmethod from_file(filename, arcname=None)[源代码]¶
Construct an appropriate ZipInfo for a file on the filesystem.
- header_offset¶
- internal_attr¶
- orig_filename¶
- reserved¶
- volume¶
- HiveNetCore.utils.myzipfile.error¶
BadZipFile的别名