[Zope3-checkins] CVS: Zope3/src/zope/app/contentdirective - contentdirective.py:1.1.2.4
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:26 -0500
Update of /cvs-repository/Zope3/src/zope/app/contentdirective
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/contentdirective
Modified Files:
Tag: NameGeddon-branch
contentdirective.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/zope/app/contentdirective/contentdirective.py 1.1.2.3 => 1.1.2.4 ===
--- Zope3/src/zope/app/contentdirective/contentdirective.py:1.1.2.3 Tue Dec 24 11:25:59 2002
+++ Zope3/src/zope/app/contentdirective/contentdirective.py Tue Dec 24 21:20:25 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
""" Register class directive.
@@ -51,7 +51,7 @@
__implements__ = ISubdirectiveHandler
def __init__(self, _context, class_):
- self.__id = class_
+ self.__id = class_
self.__class = _context.resolve(class_)
if isinstance(self.__class, ModuleType):
raise ConfigurationError('Content class attribute must be a class')
@@ -98,7 +98,7 @@
if not permission:
raise ConfigurationError("No permission specified")
-
+
if interface:
self.__protectByInterface(interface, permission, r)
@@ -111,7 +111,7 @@
return r
-
+
def __mimic(self, _context, class_):
"""Base security requirements on those of the given class"""
class_to_mimic = _context.resolve(class_)
@@ -121,7 +121,7 @@
args=(self.__class, class_to_mimic),
)
]
-
+
def allow(self, _context, attributes=None, interface=None):
"""Like require, but with permission_id zope.Public"""
return self.require(_context, PublicPermission, attributes, interface)
@@ -139,19 +139,19 @@
r.append((
('protectName', self.__class, name),
protectName, (self.__class, name, permission_id)))
-
+
def __protectNames(self, names, permission_id, r):
"Set a permission on a bunch of names."
for name in names.split():
self.__protectName(name.strip(), permission_id, r)
-
+
def __protectSetAttributes(self, names, permission_id, r):
"Set a permission on a bunch of names."
for name in names.split():
r.append((
('protectSetAttribute', self.__class, name),
protectSetAttribute, (self.__class, name, permission_id)))
-
+
def __protectSetSchema(self, schema, permission_id, r):
"Set a permission on a bunch of names."
schema = self.__context.resolve(schema)
@@ -173,7 +173,7 @@
"""Register a zmi factory for this class"""
id = id or self.__id
-
+
# note factories are all in one pile, services and content,
# so addable names must also act as if they were all in the
# same namespace, despite the service/content division
@@ -185,7 +185,7 @@
permission, title, description)
)
]
-
+
def provideClass(id, _class, permission=None,
title='', description=''):
"""Provide simple class setup
@@ -194,7 +194,7 @@
- set component permission
"""
-
+
assertPermission(permission)
factory = ClassFactory(_class)
if permission and (permission != 'zope.Public'):
@@ -204,5 +204,3 @@
__call__=permission))
getService(None, 'Factories').provideFactory(id, factory)
-
-