[Zope3-checkins] CVS: Zope3/src/zope/app/services - servicecontainer.py:1.1 service.py:1.8
runyaga
runyaga@thisbox.com
Tue, 4 Feb 2003 05:26:02 -0500
Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv15544
Modified Files:
service.py
Added Files:
servicecontainer.py
Log Message:
by request of SteveA, moving ServiceManagerContainer to
another file. This will eliminate some annoying cyclical
import statements.. Hooray!
=== Added File Zope3/src/zope/app/services/servicecontainer.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from zope.component.exceptions import ComponentLookupError
from zope.app.interfaces.services.service import IServiceManagerContainer
class ServiceManagerContainer:
__implements__ = IServiceManagerContainer
def hasServiceManager(self):
'''See interface IReadServiceManagerContainer'''
return hasattr(self, '_ServiceManagerContainer__sm')
def getServiceManager(self):
'''See interface IReadServiceManagerContainer'''
try:
return self.__sm
except AttributeError:
raise ComponentLookupError('no service manager defined')
def queryServiceManager(self, default=None):
'''See interface IReadServiceManagerContainer'''
return getattr(self, '_ServiceManagerContainer__sm', default)
def setServiceManager(self, sm):
'''See interface IWriteServiceManagerContainer'''
if IServiceService.isImplementedBy(sm):
self.__sm = sm
else:
raise ValueError('setServiceManager requires an IServiceService')
=== Zope3/src/zope/app/services/service.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/service.py:1.7 Mon Feb 3 10:08:48 2003
+++ Zope3/src/zope/app/services/service.py Tue Feb 4 05:26:00 2003
@@ -52,36 +52,6 @@
ModuleType = type(INameResolver)
ModuleType = ModuleType, PersistentModule
-class ServiceManagerContainer:
-
- __implements__ = IServiceManagerContainer
-
- def hasServiceManager(self):
- '''See interface IReadServiceManagerContainer'''
- return hasattr(self, '_ServiceManagerContainer__sm')
-
- def getServiceManager(self):
- '''See interface IReadServiceManagerContainer'''
-
- try:
- return self.__sm
- except AttributeError:
- raise ComponentLookupError('no service manager defined')
-
- def queryServiceManager(self, default=None):
- '''See interface IReadServiceManagerContainer'''
-
- return getattr(self, '_ServiceManagerContainer__sm', default)
-
- def setServiceManager(self, sm):
- '''See interface IWriteServiceManagerContainer'''
-
- if IServiceService.isImplementedBy(sm):
- self.__sm = sm
- else:
- raise ValueError('setServiceManager requires an IServiceService')
-
-
from zope.app.services.configuration import ConfigurationStatusProperty
from zope.app.services.configuration import NameComponentConfigurable
from zope.app.services.configuration import NamedComponentConfiguration