Small bugfix while searching string fields and added the possibility to define a text-transform on String fields.
This commit is contained in:
parent
ae4bfc9970
commit
ca7b688c00
6 changed files with 39 additions and 25 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue