[Zope3-checkins]
SVN: Zope3/trunk/src/zope/app/apidoc/classmodule/__init__.py
The class registry is not created at startup anymore but at
the first
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Jun 11 17:07:24 EDT 2004
Log message for revision 25369:
The class registry is not created at startup anymore but at the first
time it is accessed. That speeds up the Zope startup by another 1.5 sec.
-=-
Modified: Zope3/trunk/src/zope/app/apidoc/classmodule/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/classmodule/__init__.py 2004-06-11 21:06:16 UTC (rev 25368)
+++ Zope3/trunk/src/zope/app/apidoc/classmodule/__init__.py 2004-06-11 21:07:24 UTC (rev 25369)
@@ -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