Commit f36ce83e authored by Gabriel Monnerat's avatar Gabriel Monnerat

lock openoffice before the conversion only

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@45086 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8f6a1f34
...@@ -155,13 +155,13 @@ class Handler(object): ...@@ -155,13 +155,13 @@ class Handler(object):
destination_format -- extension of document as String destination_format -- extension of document as String
""" """
logger.debug("Convert: %s > %s" % (self.source_format, destination_format)) logger.debug("Convert: %s > %s" % (self.source_format, destination_format))
openoffice.acquire()
kw['source_format'] = self.source_format kw['source_format'] = self.source_format
if destination_format: if destination_format:
kw['destination_format'] = destination_format kw['destination_format'] = destination_format
kw['mimemapper'] = self._serializeMimemapper(self.source_format, kw['mimemapper'] = self._serializeMimemapper(self.source_format,
destination_format) destination_format)
kw['refresh'] = json.dumps(self.refresh) kw['refresh'] = json.dumps(self.refresh)
openoffice.acquire()
try: try:
stdout, stderr = self._callUnoConverter(*['convert'], **kw) stdout, stderr = self._callUnoConverter(*['convert'], **kw)
finally: finally:
...@@ -177,13 +177,13 @@ class Handler(object): ...@@ -177,13 +177,13 @@ class Handler(object):
Keywords Arguments: Keywords Arguments:
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()
logger.debug("getMetadata") logger.debug("getMetadata")
kw = dict(mimemapper=self._serializeMimemapper()) kw = dict(mimemapper=self._serializeMimemapper())
if base_document: if base_document:
feature_list = ['getmetadata', 'convert'] feature_list = ['getmetadata', 'convert']
else: else:
feature_list = ['getmetadata'] feature_list = ['getmetadata']
openoffice.acquire()
try: try:
stdout, stderr = self._callUnoConverter(*feature_list, **kw) stdout, stderr = self._callUnoConverter(*feature_list, **kw)
finally: finally:
...@@ -201,10 +201,10 @@ class Handler(object): ...@@ -201,10 +201,10 @@ class Handler(object):
Keyword arguments: Keyword arguments:
metadata -- expected an dictionary with metadata. metadata -- expected an dictionary with metadata.
""" """
openoffice.acquire()
metadata_pickled = json.dumps(metadata) metadata_pickled = json.dumps(metadata)
logger.debug("setMetadata") logger.debug("setMetadata")
kw = dict(metadata=encodestring(metadata_pickled)) kw = dict(metadata=encodestring(metadata_pickled))
openoffice.acquire()
try: try:
stdout, stderr = self._callUnoConverter(*['setmetadata'], **kw) stdout, stderr = self._callUnoConverter(*['setmetadata'], **kw)
finally: finally:
......
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