[Zodb-checkins] CVS: ZODB3/ZConfig - datatypes.py:1.8

Guido van Rossum guido@python.org
Thu, 16 Jan 2003 20:58:56 -0500


Update of /cvs-repository/ZODB3/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv31176

Modified Files:
	datatypes.py 
Log Message:
Add a new datatype: string-list, splits a string into words using
.split().


=== ZODB3/ZConfig/datatypes.py 1.7 => 1.8 ===
--- ZODB3/ZConfig/datatypes.py:1.7	Thu Jan 16 10:40:55 2003
+++ ZODB3/ZConfig/datatypes.py	Thu Jan 16 20:58:52 2003
@@ -128,6 +128,11 @@
         raise ValueError("not a valid boolean value: " + repr(s))
 
 
+def string_list(s):
+    """Convert a string to a list of strings using .split()."""
+    return s.split()
+
+
 port_number = RangeCheckedConversion(integer, min=1, max=0xffff).__call__
 
 
@@ -281,6 +286,7 @@
     "integer":           integer,
     "float":             float_conversion,
     "string":            str,
+    "string-list":       string_list,
     "null":              null_conversion,
     "locale":            MemoizedConversion(check_locale),
     "port-number":       port_number,