mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Moved function code inline
This commit is contained in:
parent
fffcb558f6
commit
bce0f0d5a6
|
@ -142,17 +142,16 @@ def grabclipboard():
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
if shutil.which("wl-paste"):
|
if shutil.which("wl-paste"):
|
||||||
args = ["wl-paste"]
|
|
||||||
output = subprocess.check_output(["wl-paste", "-l"]).decode()
|
output = subprocess.check_output(["wl-paste", "-l"]).decode()
|
||||||
clipboard_mimetypes = output.splitlines()
|
mimetypes = output.splitlines()
|
||||||
|
if "image/png" in mimetypes:
|
||||||
|
mimetype = "image/png"
|
||||||
|
elif mimetypes:
|
||||||
|
mimetype = mimetypes[0]
|
||||||
|
else:
|
||||||
|
mimetype = None
|
||||||
|
|
||||||
def find_mimetype():
|
args = ["wl-paste"]
|
||||||
if "image/png" in clipboard_mimetypes:
|
|
||||||
return "image/png"
|
|
||||||
if clipboard_mimetypes:
|
|
||||||
return clipboard_mimetypes[0]
|
|
||||||
|
|
||||||
mimetype = find_mimetype()
|
|
||||||
if mimetype:
|
if mimetype:
|
||||||
args.extend(["-t", mimetype])
|
args.extend(["-t", mimetype])
|
||||||
elif shutil.which("xclip"):
|
elif shutil.which("xclip"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user