Commit 1aaaedeb authored by Julien Muchembled's avatar Julien Muchembled

cloudooo: use environment python if OOo does not provide one

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@41734 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 25ade23a
...@@ -59,7 +59,8 @@ class OpenOffice(Application): ...@@ -59,7 +59,8 @@ class OpenOffice(Application):
"""Test if OpenOffice was started correctly""" """Test if OpenOffice was started correctly"""
logger.debug("Test OpenOffice %s - Pid %s" % (self.getAddress()[-1], logger.debug("Test OpenOffice %s - Pid %s" % (self.getAddress()[-1],
self.pid())) self.pid()))
args = [join(self.office_binary_path, "python"), python = join(self.office_binary_path, "python")
args = [exists(python) and python or "python",
pkg_resources.resource_filename("cloudooo", pkg_resources.resource_filename("cloudooo",
join("helper", "openoffice_tester.py")), join("helper", "openoffice_tester.py")),
"--hostname=%s" % host, "--hostname=%s" % host,
......
...@@ -71,7 +71,8 @@ class OOHandler: ...@@ -71,7 +71,8 @@ class OOHandler:
hostname, port = openoffice.getAddress() hostname, port = openoffice.getAddress()
kw['hostname'] = hostname kw['hostname'] = hostname
kw['port'] = port kw['port'] = port
command_list = [path.join(self.office_binary_path, "python"), python = path.join(self.office_binary_path, "python")
command_list = [path.exists(python) and python or "python",
pkg_resources.resource_filename("cloudooo", pkg_resources.resource_filename("cloudooo",
path.join("helper", "unoconverter.py")), path.join("helper", "unoconverter.py")),
"--uno_path='%s'" % self.uno_path, "--uno_path='%s'" % self.uno_path,
......
...@@ -108,7 +108,8 @@ class MimeMapper(object): ...@@ -108,7 +108,8 @@ class MimeMapper(object):
uno_path = kw.get("uno_path", environ.get('uno_path')) uno_path = kw.get("uno_path", environ.get('uno_path'))
office_binary_path = kw.get("office_binary_path", office_binary_path = kw.get("office_binary_path",
environ.get('office_binary_path')) environ.get('office_binary_path'))
command = [path.join(office_binary_path, "python"), python = path.join(office_binary_path, "python")
command = [path.exists(python) and python or "python",
pkg_resources.resource_filename(__name__, pkg_resources.resource_filename(__name__,
path.join("helper", "unomimemapper.py")), path.join("helper", "unomimemapper.py")),
"--uno_path=%s" % uno_path, "--uno_path=%s" % uno_path,
......
...@@ -60,7 +60,8 @@ class TestUnoConverter(cloudoooTestCase): ...@@ -60,7 +60,8 @@ class TestUnoConverter(cloudoooTestCase):
'MS Word 97')], 'MS Word 97')],
doc_type_list_by_extension=dict(doc=['com.sun.star.text.TextDocument'])) doc_type_list_by_extension=dict(doc=['com.sun.star.text.TextDocument']))
mimemapper_pickled = json.dumps(mimemapper) mimemapper_pickled = json.dumps(mimemapper)
command = [join(self.office_binary_path, "python"), python = join(self.office_binary_path, "python")
command = [exists(python) and python or "python",
pkg_resources.resource_filename("cloudooo", pkg_resources.resource_filename("cloudooo",
"helper/unoconverter.py"), "helper/unoconverter.py"),
"'--convert'", "'--convert'",
......
...@@ -52,7 +52,8 @@ class TestUnoMimeMapper(cloudoooTestCase): ...@@ -52,7 +52,8 @@ class TestUnoMimeMapper(cloudoooTestCase):
def testCreateLocalAttributes(self): def testCreateLocalAttributes(self):
"""Test if filters returns correctly the filters and types in dict""" """Test if filters returns correctly the filters and types in dict"""
hostname, host = openoffice.getAddress() hostname, host = openoffice.getAddress()
command = [path.join(self.office_binary_path, "python"), python = path.join(self.office_binary_path, "python")
command = [path.exists(python) and python or "python",
pkg_resources.resource_filename("cloudooo", "helper/unomimemapper.py"), pkg_resources.resource_filename("cloudooo", "helper/unomimemapper.py"),
"'--uno_path=%s'" % self.uno_path, "'--uno_path=%s'" % self.uno_path,
"'--office_binary_path=%s'" % self.office_binary_path, "'--office_binary_path=%s'" % self.office_binary_path,
...@@ -95,7 +96,8 @@ class TestUnoMimeMapper(cloudoooTestCase): ...@@ -95,7 +96,8 @@ class TestUnoMimeMapper(cloudoooTestCase):
error_msg = "couldn\'t connect to socket (Success)\n" error_msg = "couldn\'t connect to socket (Success)\n"
hostname, host = openoffice.getAddress() hostname, host = openoffice.getAddress()
openoffice.stop() openoffice.stop()
command = [path.join(self.office_binary_path, "python"), python = path.join(self.office_binary_path, "python")
command = [path.exists(python) and python or "python",
pkg_resources.resource_filename("cloudooo", pkg_resources.resource_filename("cloudooo",
"helper/unomimemapper.py"), "helper/unomimemapper.py"),
"'--uno_path=%s'" % self.uno_path, "'--uno_path=%s'" % self.uno_path,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment