From 48dce82650bd6738be97911ba9b6cecb0d1805bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 2 Dec 2016 20:54:35 +0800 Subject: [PATCH] Added support for MacOSX. Changed to run soffice instead of soffice.bin as soffice.bin is not executable on MacOSX. --- oobsync.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/oobsync.py b/oobsync.py index da22d52..a6107bf 100755 --- a/oobsync.py +++ b/oobsync.py @@ -20,7 +20,14 @@ if not is_found_uno: cand = os.path.dirname(cand) if os.path.exists(os.path.join(cand, "uno.py")): sys.path.append(cand) + is_found_uno = True break +# For uno.py on MacOS +if not is_found_uno: + cand = "/Applications/OpenOffice.app/Contents/MacOS" + if os.path.exists(os.path.join(cand, "uno.py")): + sys.path.append(cand) + is_found_uno = True import uno from com.sun.star.connection import NoConnectException @@ -274,7 +281,7 @@ class OpenOffice: time.sleep(2) return os.setsid() - ooexec = os.path.join(os.path.dirname(uno.__file__), "soffice.bin") + ooexec = os.path.join(os.path.dirname(uno.__file__), "soffice") try: os.execl( ooexec, ooexec,