[Zope-Checkins] CVS: Zope3/lib/python/Zope/Configuration - HookRegistry.py:1.1.2.4
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 15:34:55 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Configuration
In directory cvs.zope.org:/tmp/cvs-serv5490/lib/python/Zope/Configuration
Modified Files:
Tag: Zope-3x-branch
HookRegistry.py
Log Message:
Implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/IContainerPythonification
Along the way:
- Converted most uses of has_key to use in.
- Fixed a bug in Interface names and namesAndDescriptions methods
that caused base class attributes to be missed.
=== Zope3/lib/python/Zope/Configuration/HookRegistry.py 1.1.2.3 => 1.1.2.4 ===
def addHookable(self, hname):
- if self._reg.has_key(hname):
+ if hname in self._reg:
raise DuplicationError(hname)
try:
defaultimpl = name.resolve(hname)
@@ -56,7 +56,7 @@
def addHook(self, hookablename, hookname):
- if not self._reg.has_key(hookablename):
+ if not (hookablename in self._reg):
raise MissingHookableError(hookablename)
if self._reg[hookablename]:
raise DuplicateHookError(hookablename, hookname)