[Zope3-checkins] CVS: Packages/ZConfig - matcher.py:1.1.2.26

Fred L. Drake, Jr. fred@zope.com
Thu, 19 Dec 2002 12:35:32 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	matcher.py 
Log Message:
finish():  When a collection of arbitrary keys is specified as
           required, raise an exception if at least one is not
           provided.


=== Packages/ZConfig/matcher.py 1.1.2.25 => 1.1.2.26 ===
--- Packages/ZConfig/matcher.py:1.1.2.25	Thu Dec 19 10:18:29 2002
+++ Packages/ZConfig/matcher.py	Thu Dec 19 12:35:31 2002
@@ -117,6 +117,10 @@
             attrnames[i] = ci.attribute or key
             v = values[i]
             if v is None and ci.name == '+' and not ci.issection():
+                if ci.minOccurs > 0:
+                    raise ZConfig.ConfigurationError(
+                        "no keys defined for the %s key/value map; at least %d"
+                        " must be specified" % (ci.attribute, ci.minOccurs))
                 v = {}
                 values[i] = v
             if v is None and ci.minOccurs: