[Zope3-checkins] CVS: Zope3/src/zope/component - servicenames.py:1.3.2.1 __init__.py:1.3.2.1
Sidnei da Silva
sidnei@x3ng.com.br
Tue, 11 Feb 2003 09:42:04 -0500
Update of /cvs-repository/Zope3/src/zope/component
In directory cvs.zope.org:/tmp/cvs-serv18615/src/zope/component
Modified Files:
Tag: paris-copypasterename-branch
__init__.py
Added Files:
Tag: paris-copypasterename-branch
servicenames.py
Log Message:
Updating from HEAD to make sure everything still works before merging
=== Added File Zope3/src/zope/component/servicenames.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.
#
##############################################################################
"""
Default service names
$Id: servicenames.py,v 1.3.2.1 2003/02/11 14:41:33 sidnei Exp $
"""
HubIds = 'HubIds'
Events = 'Events'
Subscription = 'Subscription'
ErrorReports = 'ErrorReportingService'
Roles = 'Roles'
Permissions = 'Permissions'
Adapters = 'Adapters'
Authentication = 'Authentication'
Interfaces = 'Interfaces'
Utilities = 'Utilities'
Skins = 'Skins'
Views = 'Views'
ResourceService = 'Resources'
Factories = 'Factories'
Workflows = 'Workflows'
=== Zope3/src/zope/component/__init__.py 1.3 => 1.3.2.1 ===
--- Zope3/src/zope/component/__init__.py:1.3 Mon Feb 3 12:43:29 2003
+++ Zope3/src/zope/component/__init__.py Tue Feb 11 09:41:33 2003
@@ -19,6 +19,8 @@
from zope.component.interfaces import IComponentArchitecture
from zope.component.exceptions import ComponentLookupError
from zope.component.service import serviceManager
+from zope.component.servicenames import Adapters, Skins, ResourceService
+from zope.component.servicenames import Factories
__implements__ = IComponentArchitecture
@@ -60,14 +62,14 @@
def getAdapter(object, interface, name='', context=None):
if context is None:
context = object
- return getService(context, 'Adapters').getAdapter(
+ return getService(context, Adapters).getAdapter(
object, interface, name)
def queryAdapter(object, interface, default=None, name='', context=None):
if context is None:
context = object
try:
- adapters = getService(context, 'Adapters')
+ adapters = getService(context, Adapters)
except ComponentLookupError:
# Oh blast, no adapter service. We're probably just running from a test
return default
@@ -78,22 +80,22 @@
# Factory service
def createObject(context, name, *args, **kwargs):
- return getService(context, 'Factories').createObject(name, *args, **kwargs)
+ return getService(context, Factories).createObject(name, *args, **kwargs)
def getFactory(context, name):
- return getService(context, 'Factories').getFactory(name)
+ return getService(context, Factories).getFactory(name)
def queryFactory(context, name, default=None):
- return getService(context, 'Factories').queryFactory(name, default)
+ return getService(context, Factories).queryFactory(name, default)
def getFactoryInterfaces(context, name):
- return getService(context, 'Factories').getInterfaces(name)
+ return getService(context, Factories).getInterfaces(name)
# Skin service
def getSkin(wrapped_object, name, view_type):
return getService(wrapped_object,
- 'Skins').getSkin(wrapped_object, name, view_type)
+ Skins).getSkin(wrapped_object, name, view_type)
# View service
@@ -128,12 +130,12 @@
def getResource(wrapped_object, name, request):
return getService(wrapped_object,
- 'Resources').getResource(
+ ResourceService).getResource(
wrapped_object, name, request)
def queryResource(wrapped_object, name, request, default=None):
return getService(wrapped_object,
- 'Resources').queryResource(
+ ResourceService).queryResource(
wrapped_object, name, request, default)