[CMF-checkins] CVS: CMF/CMFDefault - Document.py:1.65 NewsItem.py:1.22

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Jan 20 17:26:29 EST 2004


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv9173/CMFDefault

Modified Files:
	Document.py NewsItem.py 
Log Message:
minor cleanups


=== CMF/CMFDefault/Document.py 1.64 => 1.65 ===
--- CMF/CMFDefault/Document.py:1.64	Wed Jan  7 11:31:46 2004
+++ CMF/CMFDefault/Document.py	Tue Jan 20 17:26:28 2004
@@ -132,9 +132,6 @@
     def _edit(self, text, text_format='', safety_belt=''):
         """ Edit the Document and cook the body.
         """
-        level = self._stx_level
-        if not text_format:
-            text_format = self.text_format
         if not self._safety_belt_update(safety_belt=safety_belt):
             msg = ("Intervening changes from elsewhere detected."
                    " Please refetch the document and reapply your changes."
@@ -142,14 +139,17 @@
                    " browser 'back' button, but will have to apply them"
                    " to a freshly fetched copy.)")
             raise EditingConflict(msg)
+
+        self.text = text
+
+        if not text_format:
+            text_format = self.text_format
         if text_format == 'html':
-            self.text = self.cooked_text = text
+            self.cooked_text = text
         elif text_format == 'plain':
-            self.text = text
-            self.cooked_text = html_quote(text).replace('\n','<br />')
+            self.cooked_text = html_quote(text).replace('\n', '<br />')
         else:
-            self.cooked_text = format_stx(text=text, level=level)
-            self.text = text
+            self.cooked_text = format_stx(text=text, level=self._stx_level)
 
     security.declareProtected(ModifyPortalContent, 'edit')
     def edit( self


=== CMF/CMFDefault/NewsItem.py 1.21 => 1.22 ===
--- CMF/CMFDefault/NewsItem.py:1.21	Tue Jul 15 11:50:51 2003
+++ CMF/CMFDefault/NewsItem.py	Tue Jan 20 17:26:28 2004
@@ -15,14 +15,14 @@
 $Id$
 """
 
+from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass
-from Document import Document
-from utils import parseHeadersBody
 
-from Products.CMFCore.CMFCorePermissions import View
 from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
-from AccessControl import ClassSecurityInfo
-from Products.CMFCore.WorkflowCore import WorkflowAction
+from Products.CMFCore.CMFCorePermissions import View
+
+from Document import Document
+
 
 factory_type_information = (
   { 'id'             : 'News Item'
@@ -76,6 +76,7 @@
               )
     self._setObject(id, o)
 
+
 class NewsItem( Document ):
     """
         A News Item
@@ -99,6 +100,4 @@
             self.setDescription( description )
         Document.edit( self, text_format, text )
 
-
 InitializeClass( NewsItem )
-




More information about the CMF-checkins mailing list