Added setuptools and published to PyPI, so that it can be installed with pip.
This commit is contained in:
parent
a11884156f
commit
cef4425d28
0
README.rst
Normal file
0
README.rst
Normal file
32
obasync.py → bin/obasync
Executable file → Normal file
32
obasync.py → bin/obasync
Executable file → Normal file
@ -8,26 +8,28 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
# Finds uno.py for MS-Windows
|
|
||||||
is_found_uno = False
|
def append_uno_path():
|
||||||
for p in sys.path:
|
""" Appends the path of the uno module to the import path. """
|
||||||
if os.path.exists(os.path.join(p, "uno.py")):
|
|
||||||
is_found_uno = True
|
is_found_uno = False
|
||||||
break
|
for p in sys.path:
|
||||||
if not is_found_uno:
|
if os.path.exists(os.path.join(p, "uno.py")):
|
||||||
|
return
|
||||||
|
# For uno.py on MacOS
|
||||||
|
cand = "/Applications/OpenOffice.app/Contents/MacOS"
|
||||||
|
if os.path.exists(os.path.join(cand, "uno.py")):
|
||||||
|
sys.path.append(cand)
|
||||||
|
return
|
||||||
|
# Finds uno.py for MS-Windows
|
||||||
cand = sys.executable
|
cand = sys.executable
|
||||||
while cand != os.path.dirname(cand):
|
while cand != os.path.dirname(cand):
|
||||||
cand = os.path.dirname(cand)
|
cand = os.path.dirname(cand)
|
||||||
if os.path.exists(os.path.join(cand, "uno.py")):
|
if os.path.exists(os.path.join(cand, "uno.py")):
|
||||||
sys.path.append(cand)
|
sys.path.append(cand)
|
||||||
is_found_uno = True
|
return
|
||||||
break
|
|
||||||
# For uno.py on MacOS
|
append_uno_path()
|
||||||
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
|
import uno
|
||||||
from com.sun.star.connection import NoConnectException
|
from com.sun.star.connection import NoConnectException
|
||||||
|
|
22
setup.py
Executable file
22
setup.py
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
# For Python shipped with OpenOffice, python is a wrapper
|
||||||
|
# for python.bin that fixes the import and library path. We should
|
||||||
|
# call python instead of python.bin. """
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
if os.path.basename(sys.executable) == "python.bin":
|
||||||
|
sys.executable = os.path.join(
|
||||||
|
os.path.dirname(sys.executable), "python")
|
||||||
|
|
||||||
|
setup(name="obasync",
|
||||||
|
version="0.1",
|
||||||
|
description="Office Basic macro source synchronizer",
|
||||||
|
url="https://github.com/imacat/obasync",
|
||||||
|
author="imacat",
|
||||||
|
author_email="imacat@mail.imacat.idv.tw",
|
||||||
|
license="Apache License, Version 2.0",
|
||||||
|
zip_safe=False,
|
||||||
|
scripts=["bin/obasync"])
|
Loading…
Reference in New Issue
Block a user