From ab9f3ae084ff2cf857432a23b09ae3e6b760081e Mon Sep 17 00:00:00 2001 From: "Jonathan G. Underwood" Date: Sun, 4 Feb 2018 12:32:56 +0000 Subject: [PATCH 1/6] Use lz4.__version__ in conf.py --- docs/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index fc0a6d73..cb1ed6af 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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. From 30d31a5e628d66d1c274c64a429be921c9da174a Mon Sep 17 00:00:00 2001 From: "Jonathan G. Underwood" Date: Sun, 4 Feb 2018 12:43:27 +0000 Subject: [PATCH 2/6] Use sphinx_bootstrap_theme for docs --- docs/conf.py | 3 +++ docs/requirements.txt | 2 ++ requirements.txt | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 docs/requirements.txt diff --git a/docs/conf.py b/docs/conf.py index cb1ed6af..f752fa81 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..150a2570 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx >= 1.6.0 +sphinx_bootstrap_theme diff --git a/requirements.txt b/requirements.txt index 4c4fc4dd..dff7e4c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -sphinx >= 1.4.8 tox pytest setuptools_scm From cfe742f0d322fdeaabcab265e910149e3e7113ef Mon Sep 17 00:00:00 2001 From: "Jonathan G. Underwood" Date: Sun, 4 Feb 2018 12:49:41 +0000 Subject: [PATCH 3/6] Fix formatting of list in docstring for LZ4FrameFile.seek() --- lz4/frame/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lz4/frame/__init__.py b/lz4/frame/__init__.py index 40962546..8349245f 100644 --- a/lz4/frame/__init__.py +++ b/lz4/frame/__init__.py @@ -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. From 917ad5b3d0fab94f7e3080e89857dc8d603b6394 Mon Sep 17 00:00:00 2001 From: "Jonathan G. Underwood" Date: Sun, 4 Feb 2018 12:54:53 +0000 Subject: [PATCH 4/6] Fix lists in dosctrings --- lz4/frame/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lz4/frame/__init__.py b/lz4/frame/__init__.py index 8349245f..8896e865 100644 --- a/lz4/frame/__init__.py +++ b/lz4/frame/__init__.py @@ -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`. @@ -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 @@ -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. From 1df99e8a905885666b18701de581c0a26c3e3f78 Mon Sep 17 00:00:00 2001 From: "Jonathan G. Underwood" Date: Sun, 4 Feb 2018 12:57:39 +0000 Subject: [PATCH 5/6] Fix some missing docstring linking --- lz4/frame/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lz4/frame/__init__.py b/lz4/frame/__init__.py index 8896e865..6c90dda2 100644 --- a/lz4/frame/__init__.py +++ b/lz4/frame/__init__.py @@ -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). @@ -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: From 6a8fcea95958ed6edbb45b82a443b0bdcee17cf0 Mon Sep 17 00:00:00 2001 From: "Jonathan G. Underwood" Date: Sun, 4 Feb 2018 12:59:49 +0000 Subject: [PATCH 6/6] Clarify quickstart slightly --- docs/quickstart.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 539db1e5..fdb14c1b 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -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()`,