mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Documented deprecation
This commit is contained in:
parent
86944abbab
commit
5df83a57ff
|
@ -53,6 +53,18 @@ Before Pillow 8.3.0, ``ImagePalette`` required palette data of particular length
|
||||||
default, and the size parameter could be used to override that. Pillow 8.3.0 removed
|
default, and the size parameter could be used to override that. Pillow 8.3.0 removed
|
||||||
the default required length, also removing the need for the size parameter.
|
the default required length, also removing the need for the size parameter.
|
||||||
|
|
||||||
|
ImageShow.Viewer.show_file file argument
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. deprecated:: 9.1.0
|
||||||
|
|
||||||
|
The ``file`` argument in :py:meth:`~PIL.ImageShow.Viewer.show_file()` has been
|
||||||
|
deprecated, replaced by ``path``.
|
||||||
|
|
||||||
|
In effect, ``viewer.show_file("test.jpg")`` will continue to work unchanged.
|
||||||
|
``viewer.show_file(file="test.jpg")`` will raise a deprecation warning, and suggest
|
||||||
|
``viewer.show_file(path="test.jpg")`` instead.
|
||||||
|
|
||||||
Removed features
|
Removed features
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,12 @@ class Viewer:
|
||||||
return self.show_file(self.save_image(image), **options)
|
return self.show_file(self.save_image(image), **options)
|
||||||
|
|
||||||
def show_file(self, path=None, **options):
|
def show_file(self, path=None, **options):
|
||||||
"""Display given file."""
|
"""
|
||||||
|
Display given file.
|
||||||
|
|
||||||
|
Before Pillow 9.1.0, the first argument was ``file``. This is now deprecated,
|
||||||
|
and ``path`` should be used instead.
|
||||||
|
"""
|
||||||
if path is None:
|
if path is None:
|
||||||
if "file" in options:
|
if "file" in options:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
|
@ -157,7 +162,12 @@ class MacViewer(Viewer):
|
||||||
return command
|
return command
|
||||||
|
|
||||||
def show_file(self, path=None, **options):
|
def show_file(self, path=None, **options):
|
||||||
"""Display given file"""
|
"""
|
||||||
|
Display given file.
|
||||||
|
|
||||||
|
Before Pillow 9.1.0, the first argument was ``file``. This is now deprecated,
|
||||||
|
and ``path`` should be used instead.
|
||||||
|
"""
|
||||||
if path is None:
|
if path is None:
|
||||||
if "file" in options:
|
if "file" in options:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
|
@ -194,7 +204,12 @@ class UnixViewer(Viewer):
|
||||||
return f"({command} {quote(file)}; rm -f {quote(file)})&"
|
return f"({command} {quote(file)}; rm -f {quote(file)})&"
|
||||||
|
|
||||||
def show_file(self, path=None, **options):
|
def show_file(self, path=None, **options):
|
||||||
"""Display given file"""
|
"""
|
||||||
|
Display given file.
|
||||||
|
|
||||||
|
Before Pillow 9.1.0, the first argument was ``file``. This is now deprecated,
|
||||||
|
and ``path`` should be used instead.
|
||||||
|
"""
|
||||||
if path is None:
|
if path is None:
|
||||||
if "file" in options:
|
if "file" in options:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user