[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/__init__.py Backport speedup.

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Jul 1 16:06:57 EDT 2004


Log message for revision 26029:
Backport speedup.



-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/__init__.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/__init__.py	2004-07-01 20:05:31 UTC (rev 26028)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/apidoc/classmodule/__init__.py	2004-07-01 20:06:57 UTC (rev 26029)
@@ -537,7 +537,7 @@
     def __init__(self):
         """Initialize object."""
         super(ClassModule, self).__init__(None, '', None, False)
-        self.__setup()
+        self.__isSetup = False
 
     def __setup(self):
         """Setup module and class tree."""
@@ -556,7 +556,21 @@
         """See Module class."""
         return ''
 
+    def get(self, key, default=None):
+        """See zope.app.container.interfaces.IReadContainer."""
+        if self.__isSetup is False:
+            self.__setup()
+            self.__isSetup = True
+        return super(ClassModule, self).get(key, default)
 
+    def items(self):
+        """See zope.app.container.interfaces.IReadContainer."""
+        if self.__isSetup is False:
+            self.__setup()
+            self.__isSetup = True
+        return super(ClassModule, self).items()
+
+
 class ClassRegistry(dict):
     """A simple registry for classes.
 



More information about the Zope3-Checkins mailing list