lzma module: Rewrap docstrings at 72 columns, as per PEP 8.
This commit is contained in:
parent
4604980854
commit
801985e4b7
31
Lib/lzma.py
31
Lib/lzma.py
|
@ -55,7 +55,7 @@ class LZMAFile(io.BufferedIOBase):
|
||||||
be an existing file object to read from or write to.
|
be an existing file object to read from or write to.
|
||||||
|
|
||||||
mode can be "r" for reading (default), "w" for (over)writing, or
|
mode can be "r" for reading (default), "w" for (over)writing, or
|
||||||
"a" for appending. These can equivalently be given as "rb", "wb",
|
"a" for appending. These can equivalently be given as "rb", "wb"
|
||||||
and "ab" respectively.
|
and "ab" respectively.
|
||||||
|
|
||||||
format specifies the container format to use for the file.
|
format specifies the container format to use for the file.
|
||||||
|
@ -381,23 +381,24 @@ def open(filename, mode="rb", *,
|
||||||
encoding=None, errors=None, newline=None):
|
encoding=None, errors=None, newline=None):
|
||||||
"""Open an LZMA-compressed file in binary or text mode.
|
"""Open an LZMA-compressed file in binary or text mode.
|
||||||
|
|
||||||
filename can be either an actual file name (given as a str or bytes object),
|
filename can be either an actual file name (given as a str or bytes
|
||||||
in which case the named file is opened, or it can be an existing file object
|
object), in which case the named file is opened, or it can be an
|
||||||
to read from or write to.
|
existing file object to read from or write to.
|
||||||
|
|
||||||
The mode argument can be "r", "rb" (default), "w", "wb", "a", or "ab" for
|
The mode argument can be "r", "rb" (default), "w", "wb", "a" or "ab"
|
||||||
binary mode, or "rt", "wt" or "at" for text mode.
|
for binary mode, or "rt", "wt" or "at" for text mode.
|
||||||
|
|
||||||
The format, check, preset and filters arguments specify the compression
|
The format, check, preset and filters arguments specify the
|
||||||
settings, as for LZMACompressor, LZMADecompressor and LZMAFile.
|
compression settings, as for LZMACompressor, LZMADecompressor and
|
||||||
|
LZMAFile.
|
||||||
|
|
||||||
For binary mode, this function is equivalent to the LZMAFile constructor:
|
For binary mode, this function is equivalent to the LZMAFile
|
||||||
LZMAFile(filename, mode, ...). In this case, the encoding, errors and
|
constructor: LZMAFile(filename, mode, ...). In this case, the
|
||||||
newline arguments must not be provided.
|
encoding, errors and newline arguments must not be provided.
|
||||||
|
|
||||||
For text mode, a LZMAFile object is created, and wrapped in an
|
For text mode, a LZMAFile object is created, and wrapped in an
|
||||||
io.TextIOWrapper instance with the specified encoding, error handling
|
io.TextIOWrapper instance with the specified encoding, error
|
||||||
behavior, and line ending(s).
|
handling behavior, and line ending(s).
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if "t" in mode:
|
if "t" in mode:
|
||||||
|
@ -427,7 +428,7 @@ def compress(data, format=FORMAT_XZ, check=-1, preset=None, filters=None):
|
||||||
Refer to LZMACompressor's docstring for a description of the
|
Refer to LZMACompressor's docstring for a description of the
|
||||||
optional arguments *format*, *check*, *preset* and *filters*.
|
optional arguments *format*, *check*, *preset* and *filters*.
|
||||||
|
|
||||||
For incremental compression, use an LZMACompressor object instead.
|
For incremental compression, use an LZMACompressor instead.
|
||||||
"""
|
"""
|
||||||
comp = LZMACompressor(format, check, preset, filters)
|
comp = LZMACompressor(format, check, preset, filters)
|
||||||
return comp.compress(data) + comp.flush()
|
return comp.compress(data) + comp.flush()
|
||||||
|
@ -439,7 +440,7 @@ def decompress(data, format=FORMAT_AUTO, memlimit=None, filters=None):
|
||||||
Refer to LZMADecompressor's docstring for a description of the
|
Refer to LZMADecompressor's docstring for a description of the
|
||||||
optional arguments *format*, *check* and *filters*.
|
optional arguments *format*, *check* and *filters*.
|
||||||
|
|
||||||
For incremental decompression, use a LZMADecompressor object instead.
|
For incremental decompression, use an LZMADecompressor instead.
|
||||||
"""
|
"""
|
||||||
results = []
|
results = []
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in New Issue