Small bugfix while searching string fields and added the possibility to define a text-transform on String fields.

This commit is contained in:
Gaetan Delannay 2010-04-16 17:07:34 +02:00
parent ae4bfc9970
commit ca7b688c00
6 changed files with 39 additions and 25 deletions

View file

@ -436,16 +436,20 @@ class FileWrapper:
convScript = '%s/converter.py' % os.path.dirname(appy.pod.__file__)
cmd = '%s %s "%s" %s -p%d' % (tool.unoEnabledPython, convScript,
filePath, format, tool.openOfficePort)
errorMessage = executeCommand(cmd, ignoreLines='warning')
errorMessage = executeCommand(cmd)
# Even if we have an "error" message, it could be a simple warning.
# So we will continue here and, as a subsequent check for knowing if
# an error occurred or not, we will test the existence of the
# converted file (see below).
os.remove(filePath)
if errorMessage:
tool.log(CONVERSION_ERROR % (cmd, errorMessage), type='error')
return
# Return the name of the converted file.
baseName, ext = os.path.splitext(filePath)
if (ext == '.%s' % format):
filePath = '%s.res.%s' % (baseName, format)
else:
filePath = '%s.%s' % (baseName, format)
if not os.path.exists(filePath):
tool.log(CONVERSION_ERROR % (cmd, errorMessage), type='error')
return
return filePath
# ------------------------------------------------------------------------------