[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - metaConfigure.py:1.1.2.14
Shane Hathaway
shane@cvs.zope.org
Fri, 1 Feb 2002 14:23:54 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/ComponentArchitecture
In directory cvs.zope.org:/tmp/cvs-serv29215
Modified Files:
Tag: Zope-3x-branch
metaConfigure.py
Log Message:
Removed carriage returns
=== Zope3/lib/python/Zope/ComponentArchitecture/metaConfigure.py 1.1.2.13 => 1.1.2.14 ===
-# Version 1.1 (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 hooks import provideAdapter, provideUtility
-from ViewService import provideView
-from ResourceService import provideResource
-from SkinService import defineSkin
-from Zope.Configuration.name import resolve
-from Zope.Configuration import namespace
-from Service import defineService, provideService
-
-def adapter(factory, provides, for_=None):
- if for_ is not None: for_ = resolve(for_)
- provides = resolve(provides)
- return [(
- ('adapter', for_, provides),
- provideAdapter, (for_, provides, resolve(factory))
- )]
-
-def utility(component, provides):
- provides = resolve(provides)
- component = resolve(component)
- return [(
- ('utility', provides),
- provideUtility,(provides, component)
- )]
-
-def view(factory, type, name, for_=None, layer=''):
- if for_ is not None: for_ = resolve(for_)
- type = resolve(type)
- factory = resolve(factory)
- return [(
- ('view', for_, name, type,layer),
- provideView, (for_, name, type, factory, layer)
- )]
-
-def defaultView(factory, type, name, for_=None):
- if for_ is not None: for_ = resolve(for_)
- type = resolve(type)
- factory = resolve(factory)
- return [
- (('view', for_, name, type),
- provideView, (for_, name, type, factory)),
- (('view', for_, '', type),
- provideView, (for_, '', type, factory)),
- ]
-
-def resource(component, type, name, layer=''):
- type = resolve(type)
- component = resolve(component)
- return [(
- ('resource', name, type,layer),
- provideResource, (name, type, component, layer)
- )]
-
-def serviceType(name, interface):
- return [(
- ('serviceType', name),
- defineService, (name, resolve(interface))
- )]
-
-def service(name, component):
- component = resolve(component)
- return [(
- ('service', name),
- provideService, (name, component)
- )]
-
-def skin(name, type, layers):
- type = resolve(type)
- layers = [layer.strip() for layer in layers.split(',')]
- return [(
- ('skin', name, type),
- defineSkin, (name, type, layers)
- )]
-
+# This software is subject to the provisions of the Zope Public License,
+# Version 1.1 (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 hooks import provideAdapter, provideUtility
+from ViewService import provideView
+from ResourceService import provideResource
+from SkinService import defineSkin
+from Zope.Configuration.name import resolve
+from Zope.Configuration import namespace
+from Service import defineService, provideService
+
+def adapter(factory, provides, for_=None):
+ if for_ is not None: for_ = resolve(for_)
+ provides = resolve(provides)
+ return [(
+ ('adapter', for_, provides),
+ provideAdapter, (for_, provides, resolve(factory))
+ )]
+
+def utility(component, provides):
+ provides = resolve(provides)
+ component = resolve(component)
+ return [(
+ ('utility', provides),
+ provideUtility,(provides, component)
+ )]
+
+def view(factory, type, name, for_=None, layer=''):
+ if for_ is not None: for_ = resolve(for_)
+ type = resolve(type)
+ factory = resolve(factory)
+ return [(
+ ('view', for_, name, type,layer),
+ provideView, (for_, name, type, factory, layer)
+ )]
+
+def defaultView(factory, type, name, for_=None):
+ if for_ is not None: for_ = resolve(for_)
+ type = resolve(type)
+ factory = resolve(factory)
+ return [
+ (('view', for_, name, type),
+ provideView, (for_, name, type, factory)),
+ (('view', for_, '', type),
+ provideView, (for_, '', type, factory)),
+ ]
+
+def resource(component, type, name, layer=''):
+ type = resolve(type)
+ component = resolve(component)
+ return [(
+ ('resource', name, type,layer),
+ provideResource, (name, type, component, layer)
+ )]
+
+def serviceType(name, interface):
+ return [(
+ ('serviceType', name),
+ defineService, (name, resolve(interface))
+ )]
+
+def service(name, component):
+ component = resolve(component)
+ return [(
+ ('service', name),
+ provideService, (name, component)
+ )]
+
+def skin(name, type, layers):
+ type = resolve(type)
+ layers = [layer.strip() for layer in layers.split(',')]
+ return [(
+ ('skin', name, type),
+ defineSkin, (name, type, layers)
+ )]
+