[CMF-checkins] CVS: CMF/CMFCore - FSDTMLMethod.py:1.23
FSPropertiesObject.py:1.18 FSZSQLMethod.py:1.6
Yvo Schubbe
y.2004_ at wcm-solutions.de
Sun May 16 11:50:43 EDT 2004
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv23773/CMFCore
Modified Files:
FSDTMLMethod.py FSPropertiesObject.py FSZSQLMethod.py
Log Message:
- import expandpath from utils, not from DirectoryView
- import cleanup
- whitespace cleanup
=== CMF/CMFCore/FSDTMLMethod.py 1.22 => 1.23 ===
--- CMF/CMFCore/FSDTMLMethod.py:1.22 Thu Apr 29 12:13:16 2004
+++ CMF/CMFCore/FSDTMLMethod.py Sun May 16 11:50:41 2004
@@ -17,17 +17,20 @@
import Globals
from AccessControl import ClassSecurityInfo, getSecurityManager
-from OFS.DTMLMethod import DTMLMethod, decapitate, guess_content_type
from AccessControl.DTML import RestrictedDTML
from AccessControl.Role import RoleManager
from OFS.Cache import Cacheable
+from OFS.DTMLMethod import DTMLMethod, decapitate, guess_content_type
-from utils import _dtmldir, _setCacheHeaders
+from DirectoryView import registerFileExtension
+from DirectoryView import registerMetaType
+from FSObject import FSObject
from permissions import FTPAccess
from permissions import View
from permissions import ViewManagementScreens
-from DirectoryView import registerFileExtension, registerMetaType, expandpath
-from FSObject import FSObject
+from utils import _dtmldir
+from utils import _setCacheHeaders
+from utils import expandpath
_marker = [] # Create a new marker object.
=== CMF/CMFCore/FSPropertiesObject.py 1.17 => 1.18 ===
--- CMF/CMFCore/FSPropertiesObject.py:1.17 Thu Apr 29 12:13:16 2004
+++ CMF/CMFCore/FSPropertiesObject.py Sun May 16 11:50:41 2004
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
""" Customizable properties that come from the filesystem.
@@ -16,18 +16,19 @@
"""
import Globals
-import Acquisition
+from AccessControl import ClassSecurityInfo
+from Acquisition import ImplicitAcquisitionWrapper
from OFS.Folder import Folder
from OFS.PropertyManager import PropertyManager
from ZPublisher.Converters import get_converter
-from AccessControl import ClassSecurityInfo
-from utils import _dtmldir
from DirectoryView import registerFileExtension
from DirectoryView import registerMetaType
-from DirectoryView import expandpath
-from permissions import ViewManagementScreens
from FSObject import FSObject
+from permissions import ViewManagementScreens
+from utils import _dtmldir
+from utils import expandpath
+
class FSPropertiesObject (FSObject, PropertyManager):
"""FSPropertiesObjects simply hold properties."""
@@ -35,7 +36,7 @@
meta_type = 'Filesystem Properties Object'
manage_options = ({'label':'Customize', 'action':'manage_main'},)
-
+
security = ClassSecurityInfo()
security.declareProtected(ViewManagementScreens, 'manage_main')
@@ -65,7 +66,7 @@
folder = self.restrictedTraverse(fpath)
RESPONSE.redirect('%s/%s/manage_propertiesForm' % (
folder.absolute_url(), self.getId()))
-
+
def _createZODBClone(self):
"""Create a ZODB (editable) equivalent of this object."""
# Create a Folder to hold the properties.
@@ -85,7 +86,7 @@
def _readFile(self, reparse):
"""Read the data from the filesystem.
-
+
Read the file (indicated by exandpath(self._filepath), and parse the
data if necessary.
"""
@@ -112,7 +113,7 @@
try:
propname, proptv = line.split(':',1)
#XXX multi-line properties?
- proptype, propvstr = proptv.split( '=', 1 )
+ proptype, propvstr = proptv.split( '=', 1 )
propname = propname.strip()
proptype = proptype.strip()
propvstr = propvstr.strip()
@@ -129,15 +130,14 @@
except:
raise ValueError, ( 'Error processing line %s of %s:\n%s'
% (lino,fp,line) )
- self._properties = tuple(map)
+ self._properties = tuple(map)
if Globals.DevelopmentMode:
# Provide an opportunity to update the properties.
def __of__(self, parent):
- self = Acquisition.ImplicitAcquisitionWrapper(self, parent)
+ self = ImplicitAcquisitionWrapper(self, parent)
self._updateFromFS()
return self
-
Globals.InitializeClass(FSPropertiesObject)
=== CMF/CMFCore/FSZSQLMethod.py 1.5 => 1.6 ===
--- CMF/CMFCore/FSZSQLMethod.py:1.5 Thu Apr 29 12:13:16 2004
+++ CMF/CMFCore/FSZSQLMethod.py Sun May 16 11:50:41 2004
@@ -3,30 +3,25 @@
# This Software is released under the MIT License:
# http://www.opensource.org/licenses/mit-license.html
# See license.txt for more details.
-#
-# $Id$
-
-""" (not yet)Customizable ZSQL methods that come from the filesystem.
+""" (not yet) Customizable ZSQL methods that come from the filesystem.
$Id$
"""
import Globals
from AccessControl import ClassSecurityInfo
-from zLOG import LOG,ERROR
-
+from Acquisition import ImplicitAcquisitionWrapper
from Products.ZSQLMethods.SQL import SQL
+from zLOG import LOG, ERROR
-from permissions import View
-from permissions import ViewManagementScreens
from DirectoryView import registerFileExtension
from DirectoryView import registerMetaType
-from DirectoryView import expandpath
from FSObject import FSObject
-
+from permissions import View
+from permissions import ViewManagementScreens
from utils import _dtmldir
+from utils import expandpath
-import Acquisition
class FSZSQLMethod(SQL, FSObject):
"""FSZSQLMethods act like Z SQL Methods but are not directly
@@ -44,13 +39,13 @@
# Use declarative security
security = ClassSecurityInfo()
-
+
security.declareObjectProtected(View)
-
+
# Make mutators private
security.declarePrivate('manage_main','manage_edit','manage_advanced','manage_advancedForm')
manage=None
-
+
security.declareProtected(ViewManagementScreens, 'manage_customise')
manage_customise = Globals.DTMLFile('custzsql', _dtmldir)
@@ -95,16 +90,16 @@
parameters[pair[0].strip().lower()]=pair[1].strip()
# check for required an optional parameters
- try:
+ try:
title = parameters.get('title','')
connection_id = parameters.get('connection id',parameters['connection_id'])
arguments = parameters.get('arguments','')
max_rows = parameters.get('max_rows',1000)
max_cache = parameters.get('max_cache',100)
- cache_time = parameters.get('cache_time',0)
+ cache_time = parameters.get('cache_time',0)
except KeyError,e:
raise ValueError,"The '%s' parameter is required but was not supplied" % e
-
+
self.manage_edit(title,
connection_id,
arguments,
@@ -123,11 +118,10 @@
# Provide an opportunity to update the properties.
def __of__(self, parent):
try:
- self = Acquisition.ImplicitAcquisitionWrapper(self, parent)
+ self = ImplicitAcquisitionWrapper(self, parent)
self._updateFromFS()
return self
except:
- from zLOG import LOG, ERROR
import sys
LOG('FS Z SQL Method',
ERROR,
More information about the CMF-checkins
mailing list