a2e55b6247494146893aa123a0c8fe331a4c446f
1 ## Script (Python) "plinndocument_edit"
2 ##parameters=text='', file='', SafetyBelt='', **kw
3 ##title=Edit a document
6 from Products
.CMFDefault
.exceptions
import EditingConflict
, ResourceLockedError
8 if text
!= context
.text
:
10 context
.edit( 'html', text
, file, safety_belt
= SafetyBelt
)
11 return context
.setStatus(True, 'Document changed.')
12 except (ResourceLockedError
, EditingConflict
), msg
:
13 return context
.setStatus(False, msg
)
15 return context
.setStatus(False, 'Nothing to change.')