[Zodb-checkins] CVS: Packages/ZConfig - DataTypes.py:1.1.2.3

Fred L. Drake, Jr. fred@zope.com
Mon, 9 Dec 2002 17:49:16 -0500


Update of /cvs-repository/Packages/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv5037

Modified Files:
      Tag: zconfig-schema-devel-branch
	DataTypes.py 
Log Message:
Define an identifier type.


=== Packages/ZConfig/DataTypes.py 1.1.2.2 => 1.1.2.3 ===
--- Packages/ZConfig/DataTypes.py:1.1.2.2	Mon Dec  9 11:58:47 2002
+++ Packages/ZConfig/DataTypes.py	Mon Dec  9 17:49:16 2002
@@ -101,6 +101,11 @@
         return RegularExpressionConversion.convert(self, value).lower()
 
 
+class IdentifierConversion(RegularExpressionConversion):
+    def __init__(self):
+        RegularExpressionConversion.__init__(self, "[_a-zA-Z][_a-zA-Z0-9]*")
+
+
 stock_datatypes = {
     "int":         TrivialConversion(int),
     "float":       TrivialConversion(float),
@@ -108,6 +113,7 @@
     "locale":      MemoizedConversion(Locale().convert),
     "port-number": RangeCheckedConversion(int, min=1, max=0xffff),
     "basic-key":   BasicKeyConversion(),
+    "identifier":  IdentifierConversion(),
     }
 
 class Registry: