Skip to content

Commit

Permalink
Merge pull request #6078 from radarhere/imageshow
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Feb 23, 2022
2 parents 4fc0319 + 40561c9 commit 96516ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/reference/ImageShow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ All default viewers convert the image to be shown to PNG format.
.. autoclass:: PIL.ImageShow.EogViewer
.. autoclass:: PIL.ImageShow.XVViewer

To provide maximum functionality on Unix-based systems, temporary files created
from images will not be automatically removed by Pillow.

.. autofunction:: PIL.ImageShow.register
.. autoclass:: PIL.ImageShow.Viewer
:member-order: bysource
Expand Down
7 changes: 6 additions & 1 deletion src/PIL/ImageShow.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@

def register(viewer, order=1):
"""
The :py:func:`register` function is used to register additional viewers.
The :py:func:`register` function is used to register additional viewers::
from PIL import ImageShow
ImageShow.register(MyViewer()) # MyViewer will be used as a last resort
ImageShow.register(MySecondViewer(), 0) # MySecondViewer will be prioritised
ImageShow.register(ImageShow.XVViewer(), 0) # XVViewer will be prioritised
:param viewer: The viewer to be registered.
:param order:
Expand Down

0 comments on commit 96516ce

Please sign in to comment.