[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ComponentArchitecture - component.zcml:1.1.2.2 metaConfigure.py:1.1.2.2
Jim Fulton
jim@zope.com
Sun, 2 Jun 2002 10:35:04 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ComponentArchitecture
In directory cvs.zope.org:/tmp/cvs-serv29793/lib/python/Zope/App/ComponentArchitecture
Modified Files:
Tag: Zope3InWonderland-branch
component.zcml metaConfigure.py
Log Message:
- Added template attribute to allow views to be created from a
template source file.
- Added beginnings of a Zope debugger. This required seperating site
and server configuration.
- Added the ability to specify a config file package in the
zopeConfigure directive. Made "config.zcml" a default for the file
attribute in the include directive.
- Fixed mapply to unwrap proxied objects. This was necessary once
views became wrapped in proxies. We need to investigate why they
weren't being wrapped before.
- I updated enough system page templates and zcml directives so that:
- Zope now starts. :)
- The root folder contents listing can be viewed.
Many more templates and zcml files need to be updated to reflect the
way views are now handled.
=== Zope3/lib/python/Zope/App/ComponentArchitecture/component.zcml 1.1.2.1 => 1.1.2.2 ===
xmlns:zmi='http://namespaces.zope.org/zmi'
xmlns:browser='http://namespaces.zope.org/browser'
+ package="Zope.ComponentArchitecture"
>
<serviceType name='Utilities'
=== Zope3/lib/python/Zope/App/ComponentArchitecture/metaConfigure.py 1.1.2.1 => 1.1.2.2 ===
def _checker(_context, permission_id, allowed_interface, allowed_attributes):
if (not allowed_attributes) and (not allowed_interface):
- raise ConfigurationError(
- "Must specify allowed_interface or allowed_names "
- "to be allowed with permission_id.")
+ allowed_attributes = "__call__"
if permission_id == 'Zope.Public':
permission_id = CheckerPublic
@@ -180,27 +178,19 @@
)
]
-def defaultView(_context, type, name, factory=None, for_=None, layer='',
- permission_id=None,
- allowed_interface=None, allowed_attributes=None):
-
+def defaultView(_context, type, name, for_=None, **__kw):
- if factory is None:
- if (permission_id or allowed_attributes or allowed_interface):
- raise ConfigurationError(
- "Must specify a factory with permission_id, "
- "allowed_interface, or allowed_attributes.")
- actions = []
+ if __kw:
+ actions = view(_context, type=type, name=name, for_=for_, **__kw)
else:
- actions = view(_context, factory, type, name, for_, layer,
- permission_id, allowed_interface, allowed_attributes)
+ actions = []
if for_ is not None:
for_ = _context.resolve(for_)
type = _context.resolve(type)
actions += [Action(
- discriminator = ('defaultViewName', for_, name, type),
+ discriminator = ('defaultViewName', for_, type, name),
callable = handler,
args = ('Views','setDefaultViewName', for_, type, name),
)]