[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces -
utilities.py:1.1.2.2
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Aug 13 10:21:15 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/interfaces
In directory cvs.zope.org:/tmp/cvs-serv26395/interfaces
Modified Files:
Tag: dreamcatcher-ttwschema-branch
utilities.py
Log Message:
ZPL Headers
Some more Docs
added setName to MutableSchema
=== Zope3/src/zope/app/interfaces/utilities.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/interfaces/utilities.py:1.1.2.1 Tue Aug 12 09:19:18 2003
+++ Zope3/src/zope/app/interfaces/utilities.py Wed Aug 13 09:20:40 2003
@@ -1,3 +1,20 @@
+##############################################################################
+#
+# Copyright (c) 2003 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.
+#
+##############################################################################
+"""TTW Schema Interfaces
+
+$Id$
+"""
from zope.interface import Interface
from zope.interface.interfaces import IInterface
from zope.schema import TextLine
@@ -9,34 +26,46 @@
__name__ = TextLine(title=u'Schema Name',
description=u"Schema Name")
-class ISchemaAdding(IAdding): pass
+class ISchemaAdding(IAdding):
+ pass
class IMutableSchema(IInterface):
+ """This object represents an interface/schema that can be edited by
+ managing the fields it contains."""
def addField(name, field):
- """Add a field to schema.
- """
+ """Add a field to schema."""
def removeField(name):
- """Remove field from schema.
+ """Remove field by name from the schema.
+
+ If the field does not exist, raise an error.
"""
def renameField(orig_name, target_name):
- """Rename field.
+ """Rename a field.
+
+ If the target_name is already taken, raise an error.
"""
def insertField(name, field, position):
- """Insert a field at position.
+ """Insert a field with a given name at the specified position.
+
+ If the position does not make sense, i.e. a negative number of a
+ number larger than len(self), then an error is raised.
"""
def moveField(name, position):
- """Move field to position.
+ """Move a field (given by its name) to a particular position.
+
+ If the position does not make sense, i.e. a negative number of a
+ number larger than len(self), then an error is raised.
"""
class IMutableSchemaField(IInterfaceField):
- u"""A type of Field that has an IMutableSchema as its value."""
+ """A type of Field that has an IMutableSchema as its value."""
class IMutableSchemasField(IInterfaceField):
- u"""A type of Field that has a tuple of IMutableSchemas as its value."""
+ """A type of Field that has a tuple of IMutableSchemas as its value."""
More information about the Zope3-Checkins
mailing list