[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI - provideClass.py:1.1.2.9
Scott Robertson
srobertson@codeit.com
Sat, 9 Feb 2002 12:43:31 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI
In directory cvs.zope.org:/tmp/cvs-serv2438/lib/python/Zope/App/ZMI
Modified Files:
Tag: Zope-3x-branch
provideClass.py
Log Message:
Refactored provideClass to use different addable registries.
Fixed the tests that called provied class to pass in the appropriate
registry as needed (either ContentAddables or ServiceAddables).
Modified zope.zcml to use the new "service" namespace which provides the
provideClass directive for services.
=== Zope3/lib/python/Zope/App/ZMI/provideClass.py 1.1.2.8 => 1.1.2.9 ===
-def provideClass(qualified_name, _class, permission, title, description=''):
+def provideClass(registry, qualified_name, _class, permission, title, description=''):
"""Provide simple class setup
- create a component
@@ -37,13 +37,19 @@
"""
factory = ClassFactory(_class, permission)
provideFactory(qualified_name, factory)
- Addable.ContentAddables.provideAddable(qualified_name, title, description)
+ registry.provideAddable(qualified_name, title, description)
-def provideClassDir(name, permission_id, title, description=''):
+def ServiceClassDir(name, permission_id, title, description=''):
return ((name,
provideClass,
- (name, resolve(name), permission_id, title, description)
+ (Addable.ServiceAddables,name, resolve(name), permission_id, title, description)
),)
+
+def ContentClassDir(name, permission_id, title, description=''):
+ return ((name,
+ provideClass,
+ (Addable.ContentAddables,name, resolve(name), permission_id, title, description)
+ ),)