[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Publisher/Browser - GlobalBrowserMenuService.py:1.8 IconDirective.py:1.3 ViewMeta.py:1.8 metaConfigure.py:1.6
Jim Fulton
jim@zope.com
Tue, 19 Nov 2002 18:25:44 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Publisher/Browser
In directory cvs.zope.org:/tmp/cvs-serv11465/lib/python/Zope/App/Publisher/Browser
Modified Files:
GlobalBrowserMenuService.py IconDirective.py ViewMeta.py
metaConfigure.py
Log Message:
Two changes that were far reaching and interdependent.
- Changed existing directives that mention interfaces to register
those interfaces with the global interface service.
- Moved all configuration support (except that in Zope.Configuration)
into Zope.App. This was necessary to get the order of execution such
that the interface service was defined before directives that used
interfaces were used. This is a change that has been needed for
some time.
=== Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py:1.7 Mon Nov 11 15:20:27 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py Tue Nov 19 18:25:13 2002
@@ -21,6 +21,7 @@
from Zope.App.PageTemplate.Engine import Engine
from Zope.App.ZopePublication.Browser.PublicationTraverse \
import PublicationTraverser
+from Zope.App.ComponentArchitecture.metaConfigure import handler
class GlobalBrowserMenuService:
"""Global Browser Menu Service
@@ -134,16 +135,26 @@
self.interface = _context.resolve(for_)
def menuItem(self, _context, action, title, description='', filter=None):
- return [Action(
- discriminator = ('browser:menuItem',
- self.menu, self.interface, title),
- callable = globalBrowserMenuService.menuItem,
- args = (self.menu, self.interface,
- action, title, description, filter),
- )]
+ return [
+ Action(
+ discriminator = ('browser:menuItem',
+ self.menu, self.interface, title),
+ callable = globalBrowserMenuService.menuItem,
+ args = (self.menu, self.interface,
+ action, title, description, filter),
+ ),
+ ]
def __call__(self):
- return ()
+ return [
+ Action(
+ discriminator = None,
+ callable = handler,
+ args = ('Interfaces', 'provideInterface',
+ self.interface.__module__+'.'+self.interface.__name__,
+ self.interface)
+ )
+ ]
globalBrowserMenuService = GlobalBrowserMenuService()
=== Zope3/lib/python/Zope/App/Publisher/Browser/IconDirective.py 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/IconDirective.py:1.2 Tue Jun 25 11:26:12 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/IconDirective.py Tue Nov 19 18:25:13 2002
@@ -91,5 +91,12 @@
callable = handler,
args = ('Views', 'provideView',
for_, name, IBrowserPresentation,
- vfactory, layer))
+ vfactory, layer)),
+ Action(
+ discriminator = None,
+ callable = handler,
+ args = ('Interfaces', 'provideInterface',
+ for_.__module__+'.'+for_.__name__,
+ for_)
+ )
]
=== Zope3/lib/python/Zope/App/Publisher/Browser/ViewMeta.py 1.7 => 1.8 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/ViewMeta.py:1.7 Wed Nov 6 17:30:21 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/ViewMeta.py Tue Nov 19 18:25:13 2002
@@ -141,7 +141,7 @@
callable = handler,
args = ('Views','setDefaultViewName', self.for_, self.type, name),
)]
-
+
def _factory(self, _context, factory):
@@ -295,11 +295,23 @@
type = IBrowserPresentation
- actions += [Action(
+ actions += [
+ Action(
discriminator = ('defaultViewName', for_, type, name),
callable = handler,
args = ('Views','setDefaultViewName', for_, type, name),
)]
+
+ if for_ is not None:
+ actions += [
+ Action(
+ discriminator = None,
+ callable = handler,
+ args = ('Interfaces', 'provideInterface',
+ for_.__module__+'.'+for_.__name__,
+ for_)
+ )
+ ]
return actions
=== Zope3/lib/python/Zope/App/Publisher/Browser/metaConfigure.py 1.5 => 1.6 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/metaConfigure.py:1.5 Tue Jun 25 10:30:08 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/metaConfigure.py Tue Nov 19 18:25:13 2002
@@ -26,6 +26,7 @@
from ResourceMeta import resource
from I18nResourceMeta import I18nResource
from ViewMeta import view
+from Interface import Interface
def skin(_context, **__kw):
return _skin(_context,
@@ -44,10 +45,24 @@
type = IBrowserPresentation
- actions += [Action(
+ actions += [
+ Action(
discriminator = ('defaultViewName', for_, type, name),
callable = handler,
args = ('Views','setDefaultViewName', for_, type, name),
- )]
+ )
+ ]
+ if for_ is not None:
+ actions.append
+ (
+ Action(
+ discriminator = None,
+ callable = handler,
+ args = ('Interfaces', 'provideInterface',
+ for_.__module__+'.'+for_.__name__,
+ for_)
+ )
+ )
+
return actions