From 7a591f913d3e37a7b461acea16d4cdc1c6179a8a Mon Sep 17 00:00:00 2001 From: sandes Date: Wed, 25 Mar 2020 02:59:58 -0300 Subject: [PATCH] delete builds --- build/lib/zipfly/__init__.py | 100 ----------------------------------- build/lib/zipfly/compat.py | 74 -------------------------- 2 files changed, 174 deletions(-) delete mode 100644 build/lib/zipfly/__init__.py delete mode 100644 build/lib/zipfly/compat.py diff --git a/build/lib/zipfly/__init__.py b/build/lib/zipfly/__init__.py deleted file mode 100644 index 2748fcd..0000000 --- a/build/lib/zipfly/__init__.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Iterable ZIP archive generator. - -Derived directly from zipfile.py -""" -from __future__ import unicode_literals, print_function, with_statement - -__version__ = '1.1.3' - -from zipfile import ( - ZIP_STORED, - ZIP64_LIMIT, - ZIP_FILECOUNT_LIMIT, - ZIP_MAX_COMMENT, - ZIP_DEFLATED, - zlib, - crc32 -) - -import stat -import io -from io import RawIOBase -from zipfile import ZipFile, ZipInfo - - -class Stream(RawIOBase): - def __init__(self): - self._buffer = b'' - - def writable(self): - return True - - def write(self, b): - if self.closed: - raise ValueError('Stream was closed!') - self._buffer += b - return len(b) - - def get(self): - chunk = self._buffer - self._buffer = b'' - return chunk - - -class ZipFly: - - def __init__(self, mode='w', paths=None, chunksize=16): - - if mode not in ('w',): - raise RunTimeError("requires mode w") - - self.comment = b'Written using Buzon-ZipFly' - self.paths = paths - self.chunksize = chunksize - - def set_comment(self, comment): - - if not isinstance(comment, bytes): - str.encode(comment) - - if len(comment) >= ZIP_MAX_COMMENT: - - # trunk comment - comment = comment[:ZIP_MAX_COMMENT] - - self.comment = comment - - def reader(self, entry): - - def get_chunk(): - return entry.read(1024 * self.chunksize) - - return get_chunk() - - - def generator(self): - - stream = Stream() - - with ZipFile(stream, mode='w', ) as zf: - - for path in self.paths: - - z_info = ZipInfo.from_file(path['filesystem'], path['name']) - - with open(path['filesystem'], 'rb') as entry: - - with zf.open(z_info, mode='w') as dest: - - for chunk in iter(lambda: entry.read(1024 * self.chunksize), b''): - dest.write(chunk) - # Yield chunk of the zip file stream in bytes. - yield stream.get() - - - zf.comment = self.comment - - # ZipFile was closed. - yield stream.get() diff --git a/build/lib/zipfly/compat.py b/build/lib/zipfly/compat.py deleted file mode 100644 index a1bc3e6..0000000 --- a/build/lib/zipfly/compat.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -pythoncompat - -Copied from requests -""" - -import sys - -# ------- -# Pythons -# ------- - - -PY2 = sys.version_info[0] == 2 -PY3 = sys.version_info[0] == 3 - - -# --------- -# Specifics -# --------- - -if PY2: - builtin_str = str - bytes = str - str = unicode - basestring = basestring - numeric_types = (int, long, float) - - -elif PY3: - builtin_str = str - str = str - bytes = bytes - basestring = (str, bytes) - numeric_types = (int, float) - - -try: - from zipfile import ZIP64_VERSION -except ImportError: - ZIP64_VERSION = 45 - -try: - from zipfile import BZIP2_VERSION -except ImportError: - BZIP2_VERSION = 46 - -try: - from zipfile import ZIP_BZIP2 -except ImportError: - ZIP_BZIP2 = 12 - -try: - from zipfile import LZMA_VERSION -except ImportError: - LZMA_VERSION = 63 - -try: - from zipfile import ZIP_LZMA -except ImportError: - ZIP_LZMA = 14 - -try: - from zipfile import ZIP_MAX_COMMENT -except ImportError: - ZIP_MAX_COMMENT = (1 << 16) - 1 - - -# Copy from io -SEEK_SET = 0 # start of the stream (the default); offset should be zero or positive -SEEK_CUR = 1 # current stream position; offset may be negative -SEEK_END = 2 # end of the stream; offset is usually negative