[Zope3-checkins] CVS: Zope3/src/zope/app/services - service.py:1.28
Jim Fulton
jim@zope.com
Mon, 30 Jun 2003 12:26:46 -0400
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv18940/src/zope/app/services
Modified Files:
service.py
Log Message:
Service managers no longer try to be module services.
=== Zope3/src/zope/app/services/service.py 1.27 => 1.28 ===
--- Zope3/src/zope/app/services/service.py:1.27 Sun Jun 22 20:31:31 2003
+++ Zope3/src/zope/app/services/service.py Mon Jun 30 12:26:15 2003
@@ -49,10 +49,6 @@
from zope.app.interfaces.services.service import IServiceRegistration
from zope.app.interfaces.services.service import IServiceManager
-# Declare a tuple of all types we consider to be modules
-# (used as 2nd argument to isinstance() in method resolve() below)
-ModuleType = type(IModuleService), PersistentModule
-
from zope.app.services.registration import NameComponentRegistry
from zope.app.services.registration import NamedComponentRegistration
from zope.app.services.folder import SiteManagementFolders
@@ -62,7 +58,7 @@
class ServiceManager(PersistentModuleRegistry, NameComponentRegistry):
- implements(IServiceManager, IContainer, IModuleService)
+ implements(IServiceManager, IContainer)
def __init__(self):
PersistentModuleRegistry.__init__(self)
@@ -262,37 +258,6 @@
return mod
__import = ContextMethod(__import)
-
- def resolve(wrapped_self, name):
-
- name = name.strip()
-
- if name.endswith('.') or name.endswith('+'):
- name = name[:-1]
- repeat = 1
- else:
- repeat = 0
-
- names = name.split('.')
- last = names[-1]
- mod = '.'.join(names[:-1])
-
- if not mod:
- return wrapped_self.__import(name)
-
- while 1:
- m = wrapped_self.__import(mod)
- try:
- a = getattr(m, last)
- except AttributeError:
- if not repeat:
- return wrapped_self.__import(name)
-
- else:
- if not repeat or (not isinstance(a, ModuleType)):
- return a
- mod += '.' + last
- resolve = ContextMethod(resolve)
class ServiceRegistration(NamedComponentRegistration):