Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
#
# The short X.Y version.
import lz4
version = lz4.version.version
version = lz4.__version__
# The full version, including alpha/beta/rc tags.
release = lz4.version.version
release = lz4.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -105,6 +105,9 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#html_theme = 'sphinxdoc'
import sphinx_bootstrap_theme
html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
4 changes: 2 additions & 2 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ header adds an extra 8 bytes to the size of the compressed frame, but allows the
decompression functions to better size memory buffers during decompression.

If ``store_size`` is ``True`` the size of the uncompressed data will be stored in
the frame header for use during decompression. Default is ``True``.
the frame header. Default is ``True``.

Availability of ``store_size``: :py:func:`lz4.frame.compress()`

The ``source_size`` argument optionally specifies the uncompressed size of the
source data to be compressed. If specified, the size will be stored in the frame
header for use during decompression.
header.

Availability of ``source_size``: :py:meth:`lz4.frame.LZ4FrameCompressor.begin()`,
:py:func:`lz4.frame.compress_begin()`, :py:func:`lz4.frame.open()`,
Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx >= 1.6.0
sphinx_bootstrap_theme
29 changes: 15 additions & 14 deletions lz4/frame/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class LZ4FrameCompressor(object):
block_size (int): Sepcifies the maximum blocksize to use.
Options:

- `lz4.frame.BLOCKSIZE_DEFAULT` or 0: the lz4 library default
- `lz4.frame.BLOCKSIZE_MAX64KB` or 4: 64 kB
- `lz4.frame.BLOCKSIZE_MAX256KB` or 5: 256 kB
- `lz4.frame.BLOCKSIZE_MAX1MB` or 6: 1 MB
- `lz4.frame.BLOCKSIZE_MAX4MB` or 7: 4 MB
- `lz4.frame.BLOCKSIZE_DEFAULT` or 0: the lz4 library default
- `lz4.frame.BLOCKSIZE_MAX64KB` or 4: 64 kB
- `lz4.frame.BLOCKSIZE_MAX256KB` or 5: 256 kB
- `lz4.frame.BLOCKSIZE_MAX1MB` or 6: 1 MB
- `lz4.frame.BLOCKSIZE_MAX4MB` or 7: 4 MB

If unspecified, will default to `lz4.frame.BLOCKSIZE_DEFAULT` which
is equal to `lz4.frame.BLOCKSIZE_MAX64KB`.
Expand All @@ -40,9 +40,9 @@ class LZ4FrameCompressor(object):
Values between 4-9 are recommended. 0 is the default.
The following module constants are provided as a convenience:

- `lz4.frame.COMPRESSIONLEVEL_MIN`: Minimum compression (0)
- `lz4.frame.COMPRESSIONLEVEL_MINHC`: Minimum high-compression (3)
- `lz4.frame.COMPRESSIONLEVEL_MAX`: Maximum compression (16)
- `lz4.frame.COMPRESSIONLEVEL_MIN`: Minimum compression (0)
- `lz4.frame.COMPRESSIONLEVEL_MINHC`: Minimum high-compression (3)
- `lz4.frame.COMPRESSIONLEVEL_MAX`: Maximum compression (16)

content_checksum (bool): Specifies whether to enable checksumming of
the payload content. If ``True`` a checksum of the uncompressed data
Expand Down Expand Up @@ -572,9 +572,9 @@ def seek(self, offset, whence=io.SEEK_SET):
The new position is specified by ``offset``, relative to the position
indicated by ``whence``. Possible values for ``whence`` are:

io.SEEK_SET or 0: start of stream (default): offset must not be negative
io.SEEK_CUR or 1: current stream position
io.SEEK_END or 2: end of stream; offset must not be positive
- io.SEEK_SET or 0: start of stream (default): offset must not be negative
- io.SEEK_CUR or 1: current stream position
- io.SEEK_END or 2: end of stream; offset must not be positive

Returns the new file position.

Expand Down Expand Up @@ -631,10 +631,10 @@ def open(filename, mode="rb",
``'x'``, ``'xb'``, ``'a'``, or ``'ab'`` for binary mode, or ``'rt'``,
``'wt'``, ``'xt'``, or ``'at'`` for text mode.

For binary mode, this function is equivalent to the ``LZ4FrameFile``
constructor: ``LZ4FrameFile(filename, mode, ...)``.
For binary mode, this function is equivalent to the `LZ4FrameFile`
constructor: `LZ4FrameFile(filename, mode, ...)`.

For text mode, an ``LZ4FFile`` object is created, and wrapped in an
For text mode, an `LZ4FrameFile` object is created, and wrapped in an
``io.TextIOWrapper`` instance with the specified encoding, error handling
behavior, and line ending(s).

Expand Down Expand Up @@ -668,6 +668,7 @@ def open(filename, mode="rb",
`lz4.frame.LZ4FrameCompressor`.
auto_flush (bool): Compressor setting. See
`lz4.frame.LZ4FrameCompressor`.

"""
if "t" in mode:
if "b" in mode:
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
sphinx >= 1.4.8
tox
pytest
setuptools_scm
Expand Down