mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Reformat variable name following PEP8
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
0b6ab79145
commit
e06edcb527
|
@ -141,13 +141,13 @@ def grabclipboard():
|
|||
return None
|
||||
else:
|
||||
if os.getenv("WAYLAND_DISPLAY"):
|
||||
sessiontype = "wayland"
|
||||
session_type = "wayland"
|
||||
elif os.getenv("DISPLAY"):
|
||||
sessiontype = "x11"
|
||||
session_type = "x11"
|
||||
else: # Session type check failed
|
||||
sessiontype = None
|
||||
session_type = None
|
||||
|
||||
if shutil.which("wl-paste") and sessiontype in ["wayland", None]:
|
||||
if shutil.which("wl-paste") and session_type in ["wayland", None]:
|
||||
output = subprocess.check_output(["wl-paste", "-l"]).decode()
|
||||
mimetypes = output.splitlines()
|
||||
if "image/png" in mimetypes:
|
||||
|
@ -160,7 +160,7 @@ def grabclipboard():
|
|||
args = ["wl-paste"]
|
||||
if mimetype:
|
||||
args.extend(["-t", mimetype])
|
||||
elif shutil.which("xclip") and sessiontype in ["x11", None]:
|
||||
elif shutil.which("xclip") and session_type in ["x11", None]:
|
||||
args = ["xclip", "-selection", "clipboard", "-t", "image/png", "-o"]
|
||||
else:
|
||||
msg = "wl-paste or xclip is required for ImageGrab.grabclipboard() on Linux"
|
||||
|
|
Loading…
Reference in New Issue
Block a user