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
|
@ -319,7 +319,7 @@
|
|||
fullname actor/fullname|nothing;
|
||||
username actor/username|nothing"
|
||||
tal:content="python:fullname or username or actorid"/>
|
||||
<td tal:content="python:contextObj.toLocalizedTime(event['time'],long_format=True)"/>
|
||||
<td tal:content="python:contextObj.restrictedTraverse('@@plone').toLocalizedTime(event['time'],long_format=True)"/>
|
||||
<td tal:condition="not: isDataChange"><tal:comment condition="rhComments" tal:content="structure rhComments"/>
|
||||
<tal:noComment condition="not: rhComments" i18n:translate="no_comments" i18n:domain="plone"/></td>
|
||||
<td tal:condition="isDataChange">
|
||||
|
@ -560,7 +560,7 @@
|
|||
</tal:creator>
|
||||
<tal:comment replace="nothing">Show last modification date</tal:comment>
|
||||
<span i18n:translate="box_last_modified" i18n:domain="plone"></span>
|
||||
<span tal:replace="python:contextObj.toLocalizedTime(contextObj.ModificationDate(),long_format=1)"></span>
|
||||
<span tal:replace="python:contextObj.restrictedTraverse('@@plone').toLocalizedTime(contextObj.ModificationDate(),long_format=1)"></span>
|
||||
</td>
|
||||
<td valign="top"><metal:pod use-macro="here/skyn/macros/macros/listPodTemplates"/>
|
||||
</td>
|
||||
|
|
0
gen/plone25/skin/search.gif
Executable file → Normal file
0
gen/plone25/skin/search.gif
Executable file → Normal file
Before Width: | Height: | Size: 433 B After Width: | Height: | Size: 433 B |
0
gen/plone25/skin/waiting.gif
Executable file → Normal file
0
gen/plone25/skin/waiting.gif
Executable file → Normal file
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -6,7 +6,7 @@ import os, os.path, time, mimetypes, unicodedata, random
|
|||
import appy.pod
|
||||
from appy.gen import Search
|
||||
from appy.gen.utils import sequenceTypes
|
||||
from appy.shared.utils import getOsTempFolder
|
||||
from appy.shared.utils import getOsTempFolder, executeCommand
|
||||
from appy.shared.xml_parser import XmlMarshaller
|
||||
|
||||
# Some error messages ----------------------------------------------------------
|
||||
|
@ -372,6 +372,7 @@ class AbstractWrapper:
|
|||
self.o.addDataChange(data, labels=False)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
CONVERSION_ERROR = 'An error occurred while executing command "%s". %s'
|
||||
class FileWrapper:
|
||||
'''When you get, from an appy object, the value of a File attribute, you
|
||||
get an instance of this class.'''
|
||||
|
@ -434,9 +435,11 @@ 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)
|
||||
res = os.system(cmd)
|
||||
errorMessage = executeCommand(cmd, ignoreLines='warning')
|
||||
os.remove(filePath)
|
||||
if res != 0: return
|
||||
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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue