Commit 932d06be authored by Gabriel Monnerat's avatar Gabriel Monnerat

revert part of r38626 and remove attributes not used

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@38628 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e45e2121
...@@ -31,6 +31,7 @@ from os import environ ...@@ -31,6 +31,7 @@ from os import environ
from os.path import exists, join from os.path import exists, join
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from threading import Lock from threading import Lock
from sys import executable as python_path
from zope.interface import implements from zope.interface import implements
from application import Application from application import Application
from xvfb import xvfb from xvfb import xvfb
...@@ -57,7 +58,7 @@ class OpenOffice(Application): ...@@ -57,7 +58,7 @@ class OpenOffice(Application):
def _testOpenOffice(self, host, port): def _testOpenOffice(self, host, port):
"""Test if OpenOffice was started correctly""" """Test if OpenOffice was started correctly"""
logger.debug("Test OpenOffice %s - Pid %s" % (self.getAddress()[-1], self.pid())) logger.debug("Test OpenOffice %s - Pid %s" % (self.getAddress()[-1], self.pid()))
command = ["python" command = [python_path
, 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
......
...@@ -69,7 +69,7 @@ class OOHandler: ...@@ -69,7 +69,7 @@ class OOHandler:
hostname, port = openoffice.getAddress() hostname, port = openoffice.getAddress()
kw['hostname'] = hostname kw['hostname'] = hostname
kw['port'] = port kw['port'] = port
command_list = ["python" command_list = [python_path
, 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
...@@ -179,7 +179,6 @@ class OOHandler: ...@@ -179,7 +179,6 @@ class OOHandler:
base_document -- Boolean variable. if true, the document is also returned base_document -- Boolean variable. if true, the document is also returned
along with the metadata.""" along with the metadata."""
openoffice.acquire() openoffice.acquire()
mimemapper_pickled = jsonpickle.encode(mimemapper)
logger.debug("getMetadata") logger.debug("getMetadata")
kw = dict(mimemapper=self._serializeMimemapper()) kw = dict(mimemapper=self._serializeMimemapper())
if base_document: if base_document:
......
...@@ -17,7 +17,7 @@ def main(): ...@@ -17,7 +17,7 @@ def main():
opt_list, arg_list = getopt(sys.argv[1:], "", opt_list, arg_list = getopt(sys.argv[1:], "",
["port=","hostname=","uno_path="]) ["port=","hostname=","uno_path="])
except GetoptError, e: except GetoptError, e:
usage(sys.stderr, "%s \nUse --port and --hostname" % e) print >> sys.stderr, "%s \nUse --port and --hostname" % e
sys.exit(2) sys.exit(2)
for opt, arg in opt_list: for opt, arg in opt_list:
......
...@@ -34,6 +34,7 @@ from filter import Filter ...@@ -34,6 +34,7 @@ from filter import Filter
from os import environ, path from os import environ, path
from interfaces.mimemapper import IMimemapper from interfaces.mimemapper import IMimemapper
from types import InstanceType from types import InstanceType
from sys import executable as python_path
class MimeMapper(object): class MimeMapper(object):
"""Load all filters from OOo. You can get the of the filter you want or all """Load all filters from OOo. You can get the of the filter you want or all
...@@ -106,7 +107,7 @@ class MimeMapper(object): ...@@ -106,7 +107,7 @@ 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 = ["python" command = [python_path
, 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
......
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