Skip to content

Commit d05a08a

Browse files
nulanohugovk
andcommitted
formatting improvements
Co-authored-by: Hugo <hugovk@users.noreply.github.com>
1 parent 0971042 commit d05a08a

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

docs/reference/features.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. py:module:: PIL.features
12
.. py:currentmodule:: PIL.features
23
34
:py:mod:`features` Module
@@ -17,7 +18,7 @@ Support for the following modules can be checked:
1718
* ``pil``: The Pillow core module, required for all functionality.
1819
* ``tkinter``: Tkinter support.
1920
* ``freetype2``: FreeType font support via :py:func:`PIL.ImageFont.truetype`.
20-
* ``littlecms2``: LittleCMS2 support via :py:mod:`PIL.ImageCms`.
21+
* ``littlecms2``: LittleCMS 2 support via :py:mod:`PIL.ImageCms`.
2122
* ``webp``: WebP image support.
2223

2324
.. autofunction:: PIL.features.check_module
@@ -31,10 +32,10 @@ If the required library was uninstalled from the system, the ``pil`` core module
3132

3233
Support for the following codecs can be checked:
3334

34-
* ``jpg``: (compile time) LibJpeg support, required for JPEG based image formats.
35-
* ``jpg_2000``: (compile time) OpenJpeg support, required for JPEG 2000 image formats.
36-
* ``zlib``: (compile time) ZLib support, required for ZLib compressed formats, such as PNG.
37-
* ``libtiff``: (compile time) LibTiff support, required for Tiff based image formats.
35+
* ``jpg``: (compile time) Libjpeg support, required for JPEG based image formats.
36+
* ``jpg_2000``: (compile time) OpenJPEG support, required for JPEG 2000 image formats.
37+
* ``zlib``: (compile time) Zlib support, required for zlib compressed formats, such as PNG.
38+
* ``libtiff``: (compile time) LibTIFF support, required for TIFF based image formats.
3839

3940
.. autofunction:: PIL.features.check_codec
4041
.. autofunction:: PIL.features.get_supported_codecs
@@ -47,7 +48,7 @@ If the required library was uninstalled from the system, the relevant module may
4748

4849
Support for the following features can be checked:
4950

50-
* ``libjpeg_turbo``: Whether Pillow was compiled against the libjpeg-turbo version of libjpeg.
51+
* ``libjpeg_turbo``: (compile time) Whether Pillow was compiled against the libjpeg-turbo version of libjpeg.
5152
* ``transp_webp``: Support for transparency in WebP images.
5253
* ``webp_mux``: (compile time) Support for EXIF data in WebP images.
5354
* ``webp_anim``: (compile time) Support for animated WebP images.

src/PIL/features.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def check_module(feature):
2121
Checks if a module is available.
2222
2323
:param feature: The module to check for.
24-
:returns: True if available, False otherwise.
24+
:returns: ``True`` if available, ``False`` otherwise.
2525
:raises ValueError: If the module is not defined in this version of Pillow.
2626
"""
2727
if not (feature in modules):
@@ -51,7 +51,7 @@ def check_codec(feature):
5151
Checks if a codec is available.
5252
5353
:param feature: The codec to check for.
54-
:returns: True if available, False otherwise.
54+
:returns: ``True`` if available, ``False`` otherwise.
5555
:raises ValueError: If the codec is not defined in this version of Pillow.
5656
"""
5757
if feature not in codecs:
@@ -85,7 +85,7 @@ def check_feature(feature):
8585
Checks if a feature is available.
8686
8787
:param feature: The feature to check for.
88-
:returns: True if available, False if unavailable, None if unknown.
88+
:returns: ``True`` if available, ``False`` if unavailable, ``None`` if unknown.
8989
:raises ValueError: If the feature is not defined in this version of Pillow.
9090
"""
9191
if feature not in features:
@@ -111,7 +111,8 @@ def check(feature):
111111
"""
112112
:param feature: A module, feature, or codec name.
113113
:returns:
114-
True if the module, feature, or codec is available, False or None otherwise.
114+
``True`` if the module, feature, or codec is available,
115+
``False`` or ``None`` otherwise.
115116
"""
116117

117118
if feature in modules:
@@ -141,9 +142,9 @@ def pilinfo(out=None, supported_formats=True):
141142
This function can be called with ``python -m PIL``.
142143
143144
:param out:
144-
The output stream to print to. Defaults to ``sys.stdout`` if None.
145+
The output stream to print to. Defaults to ``sys.stdout`` if ``None``.
145146
:param supported_formats:
146-
If True, a list of all supported image file formats will be printed.
147+
If ``True``, a list of all supported image file formats will be printed.
147148
"""
148149

149150
if out is None:

0 commit comments

Comments
 (0)