Added the possibility to log OO errors in appy.gen method File.dump and changed some code for avoiding silly Plone warnings on every user click.
This commit is contained in:
parent
0fe011e0aa
commit
fc75a42264
352 changed files with 30 additions and 23 deletions
0
shared/__init__.py
Executable file → Normal file
0
shared/__init__.py
Executable file → Normal file
0
shared/errors.py
Executable file → Normal file
0
shared/errors.py
Executable file → Normal file
0
shared/rtf.py
Executable file → Normal file
0
shared/rtf.py
Executable file → Normal file
0
shared/test.py
Executable file → Normal file
0
shared/test.py
Executable file → Normal file
19
shared/utils.py
Executable file → Normal file
19
shared/utils.py
Executable file → Normal file
|
@ -57,4 +57,23 @@ def getOsTempFolder():
|
|||
else:
|
||||
raise "Sorry, I can't find a temp folder on your machine."
|
||||
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.'''
|
||||
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
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
0.2dev unreleased
|
0
shared/xml_parser.py
Executable file → Normal file
0
shared/xml_parser.py
Executable file → Normal file
Loading…
Add table
Add a link
Reference in a new issue