]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Lib/encodings/zlib_codec.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Lib / encodings / zlib_codec.py
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Lib/encodings/zlib_codec.py b/AppPkg/Applications/Python/Python-2.7.10/Lib/encodings/zlib_codec.py
deleted file mode 100644 (file)
index 82557d0..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-""" Python 'zlib_codec' Codec - zlib compression encoding\r
-\r
-    Unlike most of the other codecs which target Unicode, this codec\r
-    will return Python string objects for both encode and decode.\r
-\r
-    Written by Marc-Andre Lemburg (mal@lemburg.com).\r
-\r
-"""\r
-import codecs\r
-import zlib # this codec needs the optional zlib module !\r
-\r
-### Codec APIs\r
-\r
-def zlib_encode(input,errors='strict'):\r
-\r
-    """ Encodes the object input and returns a tuple (output\r
-        object, length consumed).\r
-\r
-        errors defines the error handling to apply. It defaults to\r
-        'strict' handling which is the only currently supported\r
-        error handling for this codec.\r
-\r
-    """\r
-    assert errors == 'strict'\r
-    output = zlib.compress(input)\r
-    return (output, len(input))\r
-\r
-def zlib_decode(input,errors='strict'):\r
-\r
-    """ Decodes the object input and returns a tuple (output\r
-        object, length consumed).\r
-\r
-        input must be an object which provides the bf_getreadbuf\r
-        buffer slot. Python strings, buffer objects and memory\r
-        mapped files are examples of objects providing this slot.\r
-\r
-        errors defines the error handling to apply. It defaults to\r
-        'strict' handling which is the only currently supported\r
-        error handling for this codec.\r
-\r
-    """\r
-    assert errors == 'strict'\r
-    output = zlib.decompress(input)\r
-    return (output, len(input))\r
-\r
-class Codec(codecs.Codec):\r
-\r
-    def encode(self, input, errors='strict'):\r
-        return zlib_encode(input, errors)\r
-    def decode(self, input, errors='strict'):\r
-        return zlib_decode(input, errors)\r
-\r
-class IncrementalEncoder(codecs.IncrementalEncoder):\r
-    def __init__(self, errors='strict'):\r
-        assert errors == 'strict'\r
-        self.errors = errors\r
-        self.compressobj = zlib.compressobj()\r
-\r
-    def encode(self, input, final=False):\r
-        if final:\r
-            c = self.compressobj.compress(input)\r
-            return c + self.compressobj.flush()\r
-        else:\r
-            return self.compressobj.compress(input)\r
-\r
-    def reset(self):\r
-        self.compressobj = zlib.compressobj()\r
-\r
-class IncrementalDecoder(codecs.IncrementalDecoder):\r
-    def __init__(self, errors='strict'):\r
-        assert errors == 'strict'\r
-        self.errors = errors\r
-        self.decompressobj = zlib.decompressobj()\r
-\r
-    def decode(self, input, final=False):\r
-        if final:\r
-            c = self.decompressobj.decompress(input)\r
-            return c + self.decompressobj.flush()\r
-        else:\r
-            return self.decompressobj.decompress(input)\r
-\r
-    def reset(self):\r
-        self.decompressobj = zlib.decompressobj()\r
-\r
-class StreamWriter(Codec,codecs.StreamWriter):\r
-    pass\r
-\r
-class StreamReader(Codec,codecs.StreamReader):\r
-    pass\r
-\r
-### encodings module API\r
-\r
-def getregentry():\r
-    return codecs.CodecInfo(\r
-        name='zlib',\r
-        encode=zlib_encode,\r
-        decode=zlib_decode,\r
-        incrementalencoder=IncrementalEncoder,\r
-        incrementaldecoder=IncrementalDecoder,\r
-        streamreader=StreamReader,\r
-        streamwriter=StreamWriter,\r
-    )\r