From 45564fe89d7db4b819ecb8a93457a6a5129cbe51 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 14 Jul 2020 22:20:44 +1000 Subject: [PATCH] Removed domain references when referring to hypothetical code --- docs/conf.py | 7 ------- docs/handbook/writing-your-own-file-decoder.rst | 16 ++++++++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 615afe715..2d80e3170 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -115,17 +115,10 @@ nitpicky = True # if present. Example entries would be ('py:func', 'int') or # ('envvar', 'LD_LIBRARY_PATH'). nitpick_ignore = [ - ("py:meth", "_open"), - ("py:attr", "tile"), - ("py:meth", "CDC.GetHandleAttrib"), - ("py:meth", "PIL.Image.Image.convert2byte"), ("py:attr", "PIL.Image.Image.tag"), ("py:attr", "PIL.Image.Image.tag_v2"), ("py:attr", "PIL.Image.Image.tile"), ("py:data", "PIL.Image.MAX_IMAGE_PIXELS"), - ("py:func", "PIL.ImageMath.convert"), - ("py:func", "PIL.ImageMath.float"), - ("py:func", "PIL.ImageMath.int"), ("py:attr", "PIL.TiffImagePlugin.ImageFileDirectory_v2.tagtype"), ] diff --git a/docs/handbook/writing-your-own-file-decoder.rst b/docs/handbook/writing-your-own-file-decoder.rst index c73ad9cab..471ae3377 100644 --- a/docs/handbook/writing-your-own-file-decoder.rst +++ b/docs/handbook/writing-your-own-file-decoder.rst @@ -28,16 +28,16 @@ Pillow decodes files in two stages: An image plugin should contain a format handler derived from the :py:class:`PIL.ImageFile.ImageFile` base class. This class should -provide an :py:meth:`_open` method, which reads the file header and +provide an ``_open`` method, which reads the file header and sets up at least the :py:attr:`~PIL.Image.Image.mode` and :py:attr:`~PIL.Image.Image.size` attributes. To be able to load the -file, the method must also create a list of :py:attr:`tile` -descriptors, which contain a decoder name, extents of the tile, and +file, the method must also create a list of ``tile`` descriptors, +which contain a decoder name, extents of the tile, and any decoder-specific data. The format handler class must be explicitly registered, via a call to the :py:mod:`~PIL.Image` module. .. note:: For performance reasons, it is important that the - :py:meth:`_open` method quickly rejects files that do not have the + ``_open`` method quickly rejects files that do not have the appropriate contents. Example @@ -103,10 +103,10 @@ Note that the image plugin must be explicitly registered using :py:func:`PIL.Image.register_open`. Although not required, it is also a good idea to register any extensions used by this format. -The :py:attr:`tile` attribute ------------------------------ +The ``tile`` attribute +---------------------- -To be able to read the file as well as just identifying it, the :py:attr:`tile` +To be able to read the file as well as just identifying it, the ``tile`` attribute must also be set. This attribute consists of a list of tile descriptors, where each descriptor specifies how data should be loaded to a given region in the image. In most cases, only a single descriptor is used, @@ -134,7 +134,7 @@ The fields are used as follows: decoder specified by the first field in the tile descriptor tuple. If the decoder doesn’t need any parameters, use :data:`None` for this field. -Note that the :py:attr:`tile` attribute contains a list of tile descriptors, +Note that the ``tile`` attribute contains a list of tile descriptors, not just a single descriptor. Decoders