[Zope3-checkins] CVS: Zope3/src/zope/app/services - folder.py:1.14
Jim Fulton
jim at zope.com
Sun Sep 21 13:32:52 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv14716/src/zope/app/services
Modified Files:
folder.py
Log Message:
Got rid of the SiteManagementFolders class (aka Packages).
Site managers now contain site-management folders directly.
=== Zope3/src/zope/app/services/folder.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/services/folder.py:1.13 Tue Aug 12 18:00:18 2003
+++ Zope3/src/zope/app/services/folder.py Sun Sep 21 13:32:51 2003
@@ -27,54 +27,12 @@
from zope.app.interfaces.file import IDirectoryFactory
from zope.app.services.registration import RegistrationManagerContainer
from zope.app.traversing import getPath
-from zope.app.context import ContextWrapper
-from zope.context import ContextMethod
from zope.interface import implements
+from zope.app.container.contained import setitem
class SiteManagementFolder(RegistrationManagerContainer, BTreeContainer):
implements(ISiteManagementFolder)
-
-class SiteManagementFolders(BTreeContainer):
- implements(ISiteManagementFolders)
-
- def __init__(self):
- super(SiteManagementFolders, self).__init__()
- self.setObject('default', SiteManagementFolder())
-
- def queryComponent(self, type=None, filter=None, all=0):
- local = []
- path = getPath(self)
- for pkg_name in self:
- package = ContextWrapper(self[pkg_name], self, name=pkg_name)
- for name in package:
- component = package[name]
- if type is not None and not type.isImplementedBy(component):
- continue
- if filter is not None and not filter(component):
- continue
- wrapper = ContextWrapper(component, package, name=name)
- local.append({'path': "%s/%s/%s" % (path, pkg_name, name),
- 'component': wrapper,
- })
-
- if all:
- next_service_manager = getNextServiceManager(self)
- if IComponentManager.isImplementedBy(next_service_manager):
- next_service_manager.queryComponent(type, filter, all)
-
- local += list(all)
-
- return local
-
- queryComponent = ContextMethod(queryComponent)
-
- def setObject(self, name, obj):
- if not (ISiteManagementFolder.isImplementedBy(obj)
- or IBundle.isImplementedBy(obj)):
- raise TypeError("Can only add packages")
- return super(SiteManagementFolders, self).setObject(name, obj)
-
class SMFolderFactory(object):
implements(IDirectoryFactory)
@@ -87,7 +45,12 @@
# XXX Backward compatability. This is needed to support old pickles.
Package = SiteManagementFolder
+
+class SiteManagementFolders(BTreeContainer):
+ pass
Packages = SiteManagementFolders
+
import sys
+
sys.modules['zope.app.services.package'
] = sys.modules['zope.app.services.folder']
More information about the Zope3-Checkins
mailing list