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

@ -74,21 +74,10 @@ def getOsTempFolder():
return res
# ------------------------------------------------------------------------------
def executeCommand(cmd, ignoreLines=None):
'''Executes command p_cmd and returns the content of its stderr.
If p_ignoreLines is not None, we will remove from the result every line
starting with p_ignoreLines.'''
def executeCommand(cmd):
'''Executes command p_cmd and returns the content of its stderr.'''
childStdIn, childStdOut, childStdErr = os.popen3(cmd)
res = childStdErr.read()
if res and ignoreLines:
# Remove every line starting with ignoreLines
keptLines = []
for line in res.split('\n'):
line = line.strip()
if not line or line.startswith(ignoreLines): continue
else:
keptLines.append(line)
res = '\n'.join(keptLines)
childStdIn.close(); childStdOut.close(); childStdErr.close()
return res