mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 12:17:14 +03:00
Add: XDGViewer which uses xdg-open
Synopsis xdg-open { file | URL } xdg-open { --help | --manual | --version } Use 'man xdg-open' or 'xdg-open --manual' for additional info.
This commit is contained in:
parent
591e79e01e
commit
5cca90a37c
|
@ -186,6 +186,16 @@ class UnixViewer(Viewer):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|
||||||
|
class XDGViewer(UnixViewer):
|
||||||
|
"""
|
||||||
|
The freedesktop.org ``xdg-open`` command.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def get_command_ex(self, file, **options):
|
||||||
|
command = executable = "xdg-open"
|
||||||
|
return command, executable
|
||||||
|
|
||||||
|
|
||||||
class DisplayViewer(UnixViewer):
|
class DisplayViewer(UnixViewer):
|
||||||
"""
|
"""
|
||||||
The ImageMagick ``display`` command.
|
The ImageMagick ``display`` command.
|
||||||
|
@ -233,6 +243,8 @@ class XVViewer(UnixViewer):
|
||||||
|
|
||||||
|
|
||||||
if sys.platform not in ("win32", "darwin"): # unixoids
|
if sys.platform not in ("win32", "darwin"): # unixoids
|
||||||
|
if shutil.which("xdg-open"):
|
||||||
|
register(XDGViewer)
|
||||||
if shutil.which("display"):
|
if shutil.which("display"):
|
||||||
register(DisplayViewer)
|
register(DisplayViewer)
|
||||||
if shutil.which("gm"):
|
if shutil.which("gm"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user