[Zope-Checkins] CVS: Packages/ZConfig - Config.py:1.7

Fred L. Drake, Jr. fred@zope.com
Thu, 21 Nov 2002 14:21:39 -0500


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

Modified Files:
	Config.py 
Log Message:
Add a type filter to getChildSections().

=== Packages/ZConfig/Config.py 1.6 => 1.7 ===
--- Packages/ZConfig/Config.py:1.6	Thu Nov  7 13:54:39 2002
+++ Packages/ZConfig/Config.py	Thu Nov 21 14:21:08 2002
@@ -75,8 +75,11 @@
             else:
                 return None
 
-    def getChildSections(self):
-        return self._sections[:]
+    def getChildSections(self, type=None):
+        if type is None:
+            return self._sections[:]
+        else:
+            return [sect for sect in self._sections if sect.type == type]
 
     def addValue(self, key, value):
         key = key.lower()