[CMF-checkins] CVS: CMF/CMFDefault - Document.py:1.60 Link.py:1.29
utils.py:1.20
Yvo Schubbe
schubbe at web.de
Thu Sep 25 07:37:20 EDT 2003
Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv2764/CMFDefault
Modified Files:
Document.py Link.py utils.py
Log Message:
replaced bare excepts in skin scripts and removed NoWL cruft:
- added CMFResourceLockedError and IllegalHTML to CMFCoreExceptions.py
- removed usage of NoWL, updated ResourceLockedError imports
- using CMFCoreExceptions for more specific except statements in scripts
- using urlencode to encode error messages
=== CMF/CMFDefault/Document.py 1.59 => 1.60 ===
--- CMF/CMFDefault/Document.py:1.59 Tue Jul 15 11:50:51 2003
+++ CMF/CMFDefault/Document.py Thu Sep 25 07:36:49 2003
@@ -19,9 +19,9 @@
from Globals import DTMLFile, InitializeClass
from AccessControl import ClassSecurityInfo, getSecurityManager
from Acquisition import aq_base
+from webdav.Lockable import ResourceLockedError
from Products.CMFCore.PortalContent import PortalContent
-from Products.CMFCore.PortalContent import NoWL, ResourceLockedError
from Products.CMFCore.CMFCorePermissions import View
from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
from Products.CMFCore.WorkflowCore import WorkflowAction
@@ -203,7 +203,7 @@
""" Simple stab at guessing the inner format of the text """
if html_headcheck(text): return 'html'
else: return 'structured-text'
-
+
security.declarePrivate('handleText')
def handleText(self, text, format=None, stx_level=None):
""" Handles the raw text, returning headers, body, format """
@@ -320,7 +320,7 @@
def Description(self):
""" Dublin core description, also important for indexing """
return self.description
-
+
security.declareProtected(View, 'Format')
def Format(self):
""" Returns a content-type style format of the underlying source """
@@ -328,7 +328,7 @@
return 'text/html'
else:
return 'text/plain'
-
+
security.declareProtected(ModifyPortalContent, 'setFormat')
def setFormat(self, format):
""" Set text format and Dublin Core resource format.
@@ -350,9 +350,8 @@
def PUT(self, REQUEST, RESPONSE):
""" Handle HTTP (and presumably FTP?) PUT requests """
- if not NoWL:
- self.dav__init(REQUEST, RESPONSE)
- self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
+ self.dav__init(REQUEST, RESPONSE)
+ self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
body = REQUEST.get('BODY', '')
try:
=== CMF/CMFDefault/Link.py 1.28 => 1.29 ===
--- CMF/CMFDefault/Link.py:1.28 Sat Jun 28 12:31:21 2003
+++ CMF/CMFDefault/Link.py Thu Sep 25 07:36:49 2003
@@ -19,11 +19,11 @@
from Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
+from webdav.Lockable import ResourceLockedError
from Products.CMFCore.CMFCorePermissions import View
from Products.CMFCore.CMFCorePermissions import ModifyPortalContent
-from Products.CMFCore.PortalContent import PortalContent, NoWL
-from Products.CMFCore.PortalContent import ResourceLockedError
+from Products.CMFCore.PortalContent import PortalContent
from Products.CMFCore.WorkflowCore import WorkflowAction
from Products.CMFCore.utils import keywordsplitter
@@ -178,7 +178,7 @@
for key, value in self.getMetadataHeaders():
if key != 'Format' and not haveheader(key):
headers[key] = value
-
+
self._editMetadata(title=headers['Title'],
subject=headers['Subject'],
description=headers['Description'],
@@ -189,16 +189,15 @@
language=headers['Language'],
rights=headers['Rights'],
)
-
+
## FTP handlers
security.declareProtected(ModifyPortalContent, 'PUT')
def PUT(self, REQUEST, RESPONSE):
"""
Handle HTTP / WebDAV / FTP PUT requests.
"""
- if not NoWL:
- self.dav__init(REQUEST, RESPONSE)
- self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
+ self.dav__init(REQUEST, RESPONSE)
+ self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
body = REQUEST.get('BODY', '')
try:
self._writeFromPUT( body )
=== CMF/CMFDefault/utils.py 1.19 => 1.20 ===
--- CMF/CMFDefault/utils.py:1.19 Sun Feb 23 07:24:26 2003
+++ CMF/CMFDefault/utils.py Thu Sep 25 07:36:49 2003
@@ -22,6 +22,8 @@
from Globals import package_home
from AccessControl import ModuleSecurityInfo
+from Products.CMFCore.CMFCoreExceptions import IllegalHTML
+
security = ModuleSecurityInfo( 'Products.CMFDefault.utils' )
security.declarePrivate('_dtmldir')
@@ -218,7 +220,7 @@
if name:
self.metatags[ name ] = content
-
+
def unknown_startag( self, tag, attrs ):
self.setliteral()
@@ -282,9 +284,6 @@
, 'embed' : 1
, 'applet' : 1
}
-
-class IllegalHTML( ValueError ):
- pass
class StrippingParser( SGMLParser ):
More information about the CMF-checkins
mailing list