[Zope3-checkins] CVS: Zope3/src/zope/schema - __init__.py:1.6 _bootstrapfields.py:1.7 _field.py:1.6 interfaces.py:1.5

Tres Seaver tseaver@zope.com
Tue, 25 Mar 2003 06:47:57 -0500


Update of /cvs-repository/Zope3/src/zope/schema
In directory cvs.zope.org:/tmp/cvs-serv25061/zope/schema

Modified Files:
	__init__.py _bootstrapfields.py _field.py interfaces.py 
Log Message:
 - Export new IPassword field type.

=== Zope3/src/zope/schema/__init__.py 1.5 => 1.6 ===
--- Zope3/src/zope/schema/__init__.py:1.5	Mon Jan 27 21:56:45 2003
+++ Zope3/src/zope/schema/__init__.py	Tue Mar 25 06:47:56 2003
@@ -19,6 +19,6 @@
 from zope.schema._field import Field, Container, Iterable, Orderable
 from zope.schema._field import MinMaxLen, ValueSet, Sequence, Bytes, BytesLine
 from zope.schema._field import Text, TextLine, Bool, Int, Float, Tuple, List
-from zope.schema._field import Dict, Datetime
+from zope.schema._field import Password, Dict, Datetime
 from zope.schema._schema import getFields, getFieldsInOrder
 from zope.schema._schema import getFieldNames, getFieldNamesInOrder


=== Zope3/src/zope/schema/_bootstrapfields.py 1.6 => 1.7 ===
--- Zope3/src/zope/schema/_bootstrapfields.py:1.6	Fri Feb 28 09:23:23 2003
+++ Zope3/src/zope/schema/_bootstrapfields.py	Tue Mar 25 06:47:56 2003
@@ -251,13 +251,15 @@
 
 
 class TextLine(Text):
-    """A Text field with no newlines."""
+    """A text field with no newlines."""
 
     def constraint(self, value):
         # XXX we should probably use a more general definition of newlines
         return '\n' not in value
 
-
+class Password(TextLine):
+    """A text field containing a text used as a password."""
+    
 class Bool(Field):
     """A field representing a Bool."""
     _type = type(True)


=== Zope3/src/zope/schema/_field.py 1.5 => 1.6 ===
--- Zope3/src/zope/schema/_field.py:1.5	Fri Jan 24 23:05:45 2003
+++ Zope3/src/zope/schema/_field.py	Tue Mar 25 06:47:56 2003
@@ -25,10 +25,11 @@
 from zope.schema.interfaces import IMinMaxLen, IValueSet, IText, ITextLine
 from zope.schema.interfaces import IBool, IInt, IBytes, IBytesLine, IFloat
 from zope.schema.interfaces import IDatetime, ISequence, ITuple, IList, IDict
+from zope.schema.interfaces import IPassword
 
 from zope.schema._bootstrapfields import Field, Container, Iterable, Orderable
 from zope.schema._bootstrapfields import MinMaxLen, ValueSet
-from zope.schema._bootstrapfields import Text, TextLine, Bool, Int
+from zope.schema._bootstrapfields import Text, TextLine, Bool, Int, Password
 from zope.schema.fieldproperty import FieldProperty
 from datetime import datetime
 
@@ -52,6 +53,7 @@
 
 implements(Text, IText)
 implements(TextLine, ITextLine)
+implements(Password, IPassword)
 implements(Bool, IBool)
 implements(Int, IInt)
 


=== Zope3/src/zope/schema/interfaces.py 1.4 => 1.5 ===
--- Zope3/src/zope/schema/interfaces.py:1.4	Thu Jan  9 09:13:18 2003
+++ Zope3/src/zope/schema/interfaces.py	Tue Mar 25 06:47:56 2003
@@ -263,6 +263,9 @@
 class ITextLine(IText):
     u"""a Field containing a unicode string without newlines."""
 
+class IPassword(ITextLine):
+    u"""a Field containing a unicode string without newlines that is a password."""
+
 class IInt(IMinMax, IValueSet):
     u"""a Field containing an Integer Value."""