From 1251bb5c4d4a2f94896fc9f788bd23b5f8e1ab2b Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 17 Jun 2021 20:43:46 +1000 Subject: [PATCH 1/8] Add support for Mac OS --- __init__.py | 4 +- mac.py | 81 ++++++++++++++++++ pasteboard_py37/__init__.py | 16 ++++ pasteboard_py37/_native.cpython-37m-darwin.so | Bin 0 -> 38008 bytes pasteboard_py39/__init__.py | 16 ++++ pasteboard_py39/_native.cpython-39-darwin.so | Bin 0 -> 38064 bytes 6 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 mac.py create mode 100644 pasteboard_py37/__init__.py create mode 100755 pasteboard_py37/_native.cpython-37m-darwin.so create mode 100644 pasteboard_py39/__init__.py create mode 100755 pasteboard_py39/_native.cpython-39-darwin.so diff --git a/__init__.py b/__init__.py index e2ac4a6..3e73550 100644 --- a/__init__.py +++ b/__init__.py @@ -39,8 +39,8 @@ from .windows import GrabImage, CopyImage elif platform.system() == "Linux": from .linux import GrabImage, CopyImage -else: - raise("Unsupported current platform") +elif platform.system() == "Darwin": + from .mac import GrabImage, CopyImage addon_utils.enable("io_import_images_as_planes") #enable the "Import Images as Planes" addon to be used here diff --git a/mac.py b/mac.py new file mode 100644 index 0000000..c1b4ec5 --- /dev/null +++ b/mac.py @@ -0,0 +1,81 @@ +import bpy +import time +import os +import subprocess + +try: + from . import pasteboard_py37 as pasteboard +except ImportError: + from . import pasteboard_py39 as pasteboard + + +# Check if clipboard doesn't contain any file paths +def no_furls(): + script = [ + "osascript", + "-e", + '((clipboard info) as string does not contain "«class furl»") as string', + ] + popen = subprocess.Popen(script, stdout=subprocess.PIPE) + return popen.communicate()[0].decode("utf-8").strip() + + +# Save image data directly from clipboard +def save_clipboard(fullpath): + commands = [ + f'set pastedImage to (open for access POSIX file "{fullpath}" with write permission)', + "try", + " write (the clipboard as «class PNGf») to pastedImage", + "end try", + "close access pastedImage", + ] + script = ["osascript"] + for command in commands: + script += ["-e", command] + subprocess.Popen(script).wait() + + +def GrabImage(): + + timestamp = time.strftime("%y%m%d-%H%M%S") + img_name = f"PastedImage{timestamp}.png" + + bpy_addon_prefs = bpy.context.preferences.addons[__package__].preferences + + if bpy.data.filepath and bpy_addon_prefs.force_default_dir is False: + Directory = os.path.join(os.path.split(bpy.data.filepath)[0], "ImagePaste") + + if os.path.isdir(Directory) is False: + os.mkdir(Directory) + + else: + Directory = bpy_addon_prefs.default_img_dir + + img_dir = os.path.join(Directory, img_name) + + pb = pasteboard.Pasteboard() + urls = pb.get_file_urls() + contents = pb.get_contents() + + if urls is not None: + urls = list(urls) + img_dir = urls + img_name = [os.path.basename(current) for current in img_dir] + return img_dir, img_name + elif contents == "": + return 0 + else: + if no_furls(): + save_clipboard(img_dir) + + return [img_dir], [img_name] + + +# Function to copy image from given path to clipboard +def CopyImage(img_path): + script = [ + "osascript", + "-e", + f'set the clipboard to (read file POSIX file "{img_path}" as «class PNGf»)', + ] + subprocess.Popen(script).wait() diff --git a/pasteboard_py37/__init__.py b/pasteboard_py37/__init__.py new file mode 100644 index 0000000..8466ffb --- /dev/null +++ b/pasteboard_py37/__init__.py @@ -0,0 +1,16 @@ +# Pasteboard - Python interface for reading from NSPasteboard (macOS clipboard) +# Copyright (C) 2017-2021 Toby Fleming +# This Source Code Form is subject to the terms of the Mozilla Public License, +# v. 2.0. If a copy of the MPL was not distributed with this file, You can +# obtain one at https://mozilla.org/MPL/2.0/. +import sys as _sys + +assert _sys.platform == "darwin", "pasteboard only works on macOS" + +from ._native import * + + +class PasteboardType: + """Make type hints not fail on import - don't use this class""" + + pass diff --git a/pasteboard_py37/_native.cpython-37m-darwin.so b/pasteboard_py37/_native.cpython-37m-darwin.so new file mode 100755 index 0000000000000000000000000000000000000000..fb8384eb54a2ddf4b3497d45723d9aa6ee889e10 GIT binary patch literal 38008 zcmeHQ4RBo5b$)AGU<6n)Afk{uegyv#S&|6?NB)V{`tb_Zme3D&>WHV+?ptZ`YIk|> ztu1AsQLvS;ESf0ONuVJCx6?MzH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BRs(KkG;dP}i&%wV< zG$L)P_!ILHZh&YNZ{T7{tGEnnC9UEx+#+cecVSf0>RkSph`s=U{MtE+>}!&Ks8i4n zOS*5}<); zaNz$c>X$ias$YiGghUt7TXA#Jq_4*7U8%2VrLU1PE~T$=s@T37-}&c=_7#1$`qMHl z!xE{lXrD_ZGKslYt2L;6md^ws=ZBlQ)n^n0j)i!#!8(xk8E z>lUf6Xp$%Vr>TI8GSYX_ynQ*pqpE#LEBz+SbGnqilO}x?7h+uMD_ZGaCDaT0ik^i0 z)fjWNe!eMbwSFFxv|2wulC)Yszm&9EKXnNGO!n0JSpiy;ZBw?M>K*H8o2y=z^=f^Y zl2+^M&n2za*Y_l?*4N8KJJ#2aC9T#M;Sr&myl7ff!=IWC!9WygPM`1#`f8#fujUhl z)c{$ru+2pqF8U4^eV>c|ri=c*i+;&Pzbj}t8yKq+&MW|%U&{qusBaZ?!QXzDJcS~~ z{{{JRL4T<1eceTW$3@S$=pVZ1w_NmlE_wk50IWiL7rN-nU380!zR5+WT=ck$o^;U< zy6Eq^=qCkTz~@Cl<1ViMa?vLRjTIoSdC)}v3iM?z`qM6YouCW$2Vmwlq(P(*(hyP@ zDS{M58b*pC#gT4DN+In=GLdk#(fsT|x*2IZQZG^;Qa{oyNIKFkqy*9kQW7bRWFgr| z8KmFD2aVyOsN^BTMe}D3JU*2?my|qdJ6|QrD)`$&8JFH2%9(g`C}YxlLm5*(+?Db9 zJ3~3w5qH=9z91g#%ebxwZ+AU^=65rTFfw_NQ9 zQ%~UF6d%0{gnH&CM)6@=QEK2TJaR+C$yMD0``0~W(}Q@)(=~suRgcwWFS(rIc(3KO zPs9d2uQyw*c&kr{5fKkxFw`ZSWdSZc8w Date: Fri, 18 Jun 2021 15:21:08 +1000 Subject: [PATCH 2/8] no_furls function should return a boolean --- mac.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac.py b/mac.py index c1b4ec5..b1135cb 100644 --- a/mac.py +++ b/mac.py @@ -17,7 +17,7 @@ def no_furls(): '((clipboard info) as string does not contain "«class furl»") as string', ] popen = subprocess.Popen(script, stdout=subprocess.PIPE) - return popen.communicate()[0].decode("utf-8").strip() + return popen.communicate()[0].decode("utf-8").strip() == "true" # Save image data directly from clipboard From 4e019974b42c25325d2a5b9d84b2afcea50d93b2 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 18 Jun 2021 15:26:34 +1000 Subject: [PATCH 3/8] Restore check for unsupported platform to keep errors verbose --- __init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/__init__.py b/__init__.py index 3e73550..4018101 100644 --- a/__init__.py +++ b/__init__.py @@ -41,6 +41,8 @@ from .linux import GrabImage, CopyImage elif platform.system() == "Darwin": from .mac import GrabImage, CopyImage +else: + raise("Unsupported current platform") addon_utils.enable("io_import_images_as_planes") #enable the "Import Images as Planes" addon to be used here From 4a7313a0e0cc8cd5918e3563a7f6a4d843370fe8 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 18 Jun 2021 16:07:15 +1000 Subject: [PATCH 4/8] Follow repository convention --- __init__.py | 2 +- mac.py => darwin/darwin.py | 0 .../pasteboard_py37}/__init__.py | 0 .../pasteboard_py39}/__init__.py | 0 pasteboard_py37/_native.cpython-37m-darwin.so | Bin 38008 -> 0 bytes pasteboard_py39/_native.cpython-39-darwin.so | Bin 38064 -> 0 bytes 6 files changed, 1 insertion(+), 1 deletion(-) rename mac.py => darwin/darwin.py (100%) rename {pasteboard_py37 => darwin/pasteboard_py37}/__init__.py (100%) rename {pasteboard_py39 => darwin/pasteboard_py39}/__init__.py (100%) delete mode 100755 pasteboard_py37/_native.cpython-37m-darwin.so delete mode 100755 pasteboard_py39/_native.cpython-39-darwin.so diff --git a/__init__.py b/__init__.py index f3426ae..dd1d794 100644 --- a/__init__.py +++ b/__init__.py @@ -31,7 +31,7 @@ elif platform.system() == "Linux": from .linux import GrabImage, CopyImage elif platform.system() == "Darwin": - from .mac import GrabImage, CopyImage + from .darwin import GrabImage, CopyImage else: raise Exception("Unsupported current platform") diff --git a/mac.py b/darwin/darwin.py similarity index 100% rename from mac.py rename to darwin/darwin.py diff --git a/pasteboard_py37/__init__.py b/darwin/pasteboard_py37/__init__.py similarity index 100% rename from pasteboard_py37/__init__.py rename to darwin/pasteboard_py37/__init__.py diff --git a/pasteboard_py39/__init__.py b/darwin/pasteboard_py39/__init__.py similarity index 100% rename from pasteboard_py39/__init__.py rename to darwin/pasteboard_py39/__init__.py diff --git a/pasteboard_py37/_native.cpython-37m-darwin.so b/pasteboard_py37/_native.cpython-37m-darwin.so deleted file mode 100755 index fb8384eb54a2ddf4b3497d45723d9aa6ee889e10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38008 zcmeHQ4RBo5b$)AGU<6n)Afk{uegyv#S&|6?NB)V{`tb_Zme3D&>WHV+?ptZ`YIk|> ztu1AsQLvS;ESf0ONuVJCx6?MzHWR@N!KJ{c;IW*RB;seN8`{CiP%4j;z=XjurDgk_ z`?LG@t>ic%ok^zmnY;I%bI&>V-0%MEeazmYAN|+QKe$lSe2XAe@r4G+1OCOv6YH+#WWDO=l<(8a7M(TegjBjtYB{Uf5nbaUhn67_me& z$?O-8?>(R4nsH%(Xs=JwHsv%=jzhpOTKqkJS51>BFObu`lXH(G4I>dZ?9t(YWZXzO z)`IqEuCk|z>kEp_w`Gz*ZWx0}*R(6Kw-oyH+`}`CX!1usG(RdNf!r|Sp>z2+*~EoY zLWgL#JuEFv7j=}0ag7a!22C1@68r>~`Tl}F*Ek4!wi&m~D3*uU-cn)j5#a;TZvU`m zX$#0d!d^HYvTd^HwKpZ~)e8-x-S)ut*o%amP~LorewL+5h~bk8S<;FZ(*a{m!25f5vvJ=}4>(%gVJ2D#}@zVYM{0=vvgdF}wuy9wf3w zzDKr1;q3;ku6xvW%;CCVY`_XxqjhZ-cB=zPYoA@`Po-{-Iki#Ask_y*>{v2k*ENee z*de={kfdE-#D^*A)9TW;RTqy9P~uJ0Zm*4uf`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z~@Cl<1ViMa?vLRjTIoSdC)}v3iM?z`qM6YouCW$2Vmwlq(P(*(hyP@ zDS{M58b*pC#gT4DN+In=GLdk#(fsT|x*2IZQZG^;Qa{oyNIKFkqy*9kQW7bRWFgr| z8KmFD2aVyOsN^BTMe}D3JU*2?my|qdJ6|QrD)`$&8JFH2%9(g`C}YxlLm5*(+?Db9 zJ3~3w5qH=9z91g#%ebxwZ+AU^=65rTFfw_NQ9 zQ%~UF6d%0{gnH&CM)6@=QEK2TJaR+C$yMD0``0~W(}Q@)(=~suRgcwWFS(rIc(3KO zPs9d2uQyw*c&kr{5fKkxFw`ZSWdSZc8w Date: Fri, 18 Jun 2021 16:48:36 +1000 Subject: [PATCH 5/8] fix relative imports --- __init__.py | 2 +- darwin/darwin.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index dd1d794..7078fdc 100644 --- a/__init__.py +++ b/__init__.py @@ -31,7 +31,7 @@ elif platform.system() == "Linux": from .linux import GrabImage, CopyImage elif platform.system() == "Darwin": - from .darwin import GrabImage, CopyImage + from .darwin.darwin import GrabImage, CopyImage else: raise Exception("Unsupported current platform") diff --git a/darwin/darwin.py b/darwin/darwin.py index b1135cb..cee4c20 100644 --- a/darwin/darwin.py +++ b/darwin/darwin.py @@ -40,7 +40,9 @@ def GrabImage(): timestamp = time.strftime("%y%m%d-%H%M%S") img_name = f"PastedImage{timestamp}.png" - bpy_addon_prefs = bpy.context.preferences.addons[__package__].preferences + bpy_addon_prefs = bpy.context.preferences.addons[ + __package__.split(".")[0] + ].preferences if bpy.data.filepath and bpy_addon_prefs.force_default_dir is False: Directory = os.path.join(os.path.split(bpy.data.filepath)[0], "ImagePaste") From e3417d1770c57f818a687ad227679dbbcee94a2b Mon Sep 17 00:00:00 2001 From: BuildTools Date: Fri, 18 Jun 2021 18:10:07 +1000 Subject: [PATCH 6/8] update .gitignore to include mac's pasteboard modules --- .gitignore | 4 ++++ .../_native.cpython-37m-darwin.so | Bin 0 -> 38008 bytes .../_native.cpython-39-darwin.so | Bin 0 -> 38064 bytes 3 files changed, 4 insertions(+) create mode 100755 darwin/pasteboard_py37/_native.cpython-37m-darwin.so create mode 100755 darwin/pasteboard_py39/_native.cpython-39-darwin.so diff --git a/.gitignore b/.gitignore index 07c73cb..9d660cc 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,10 @@ __pycache__/ # C extensions *.so +# Darwin pasteboard modules +!_native.cpython-37m-darwin.so +!_native.cpython-39-darwin.so + # Distribution / packaging .Python build/ diff --git a/darwin/pasteboard_py37/_native.cpython-37m-darwin.so b/darwin/pasteboard_py37/_native.cpython-37m-darwin.so new file mode 100755 index 0000000000000000000000000000000000000000..fb8384eb54a2ddf4b3497d45723d9aa6ee889e10 GIT binary patch literal 38008 zcmeHQ4RBo5b$)AGU<6n)Afk{uegyv#S&|6?NB)V{`tb_Zme3D&>WHV+?ptZ`YIk|> ztu1AsQLvS;ESf0ONuVJCx6?MzHWR@N!KJ{c;IW*RB;seN8`{CiP%4j;z=XjurDgk_ z`?LG@t>ic%ok^zmnY;I%bI&>V-0%MEeazmYAN|+QKe$lSe2XAe@r4G+1OCOv6YH+#WWDO=l<(8a7M(TegjBjtYB{Uf5nbaUhn67_me& z$?O-8?>(R4nsH%(Xs=JwHsv%=jzhpOTKqkJS51>BFObu`lXH(G4I>dZ?9t(YWZXzO z)`IqEuCk|z>kEp_w`Gz*ZWx0}*R(6Kw-oyH+`}`CX!1usG(RdNf!r|Sp>z2+*~EoY zLWgL#JuEFv7j=}0ag7a!22C1@68r>~`Tl}F*Ek4!wi&m~D3*uU-cn)j5#a;TZvU`m zX$#0d!d^HYvTd^HwKpZ~)e8-x-S)ut*o%amP~LorewL+5h~bk8S<;FZ(*a{m!25f5vvJ=}4>(%gVJ2D#}@zVYM{0=vvgdF}wuy9wf3w zzDKr1;q3;ku6xvW%;CCVY`_XxqjhZ-cB=zPYoA@`Po-{-Iki#Ask_y*>{v2k*ENee z*de={kfdE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U380!zR5+WT=ck$o^;U< zy6Eq^=qCkTz~@Cl<1ViMa?vLRjTIoSdC)}v3iM?z`qM6YouCW$2Vmwlq(P(*(hyP@ zDS{M58b*pC#gT4DN+In=GLdk#(fsT|x*2IZQZG^;Qa{oyNIKFkqy*9kQW7bRWFgr| z8KmFD2aVyOsN^BTMe}D3JU*2?my|qdJ6|QrD)`$&8JFH2%9(g`C}YxlLm5*(+?Db9 zJ3~3w5qH=9z91g#%ebxwZ+AU^=65rTFfw_NQ9 zQ%~UF6d%0{gnH&CM)6@=QEK2TJaR+C$yMD0``0~W(}Q@)(=~suRgcwWFS(rIc(3KO zPs9d2uQyw*c&kr{5fKkxFw`ZSWdSZc8w Date: Fri, 18 Jun 2021 18:19:31 +1000 Subject: [PATCH 7/8] improve GrabImage return logic --- darwin/darwin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/darwin/darwin.py b/darwin/darwin.py index cee4c20..ca59474 100644 --- a/darwin/darwin.py +++ b/darwin/darwin.py @@ -69,8 +69,9 @@ def GrabImage(): else: if no_furls(): save_clipboard(img_dir) + return [img_dir], [img_name] - return [img_dir], [img_name] + return 1 # Function to copy image from given path to clipboard From 654c6b324087d5496914068578f8de21d66c9973 Mon Sep 17 00:00:00 2001 From: MW Lim Date: Fri, 18 Jun 2021 22:03:06 +1000 Subject: [PATCH 8/8] Update __init__.py Hmm not sure what happened but I probably messed it up during fetch upstream from my editor. Co-authored-by: Thanh Phan --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 7078fdc..8fe10c8 100644 --- a/__init__.py +++ b/__init__.py @@ -29,7 +29,7 @@ if platform.system() == "Windows": from .windows.windows import GrabImage, CopyImage elif platform.system() == "Linux": - from .linux import GrabImage, CopyImage + from .linux.linux import GrabImage, CopyImage elif platform.system() == "Darwin": from .darwin.darwin import GrabImage, CopyImage else: