[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Publisher/Browser - GlobalBrowserMenuService.py:1.5.6.1 IconDirective.py:1.2.6.1 ViewMeta.py:1.4.6.1 metaConfigure.py:1.5.6.5

Jim Fulton jim@zope.com
Thu, 24 Oct 2002 06:07:51 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/Publisher/Browser
In directory cvs.zope.org:/tmp/cvs-serv24647/lib/python/Zope/App/Publisher/Browser

Modified Files:
      Tag: Zope3-Bangalore-TTW-Branch
	GlobalBrowserMenuService.py IconDirective.py ViewMeta.py 
	metaConfigure.py 
Log Message:
Added more automatic interface registration while refering to
interfaces in component registration directives.

In doing this I was forced to clean up the configuratio files outside
of Zope.App. In particular, there shouldn't be any configuration files
outside of Zope.App and Zope.Configuration. This second task was much
more involved than the first. :/




=== Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py 1.5 => 1.5.6.1 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py:1.5	Tue Oct  1 08:49:08 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/GlobalBrowserMenuService.py	Thu Oct 24 06:07:21 2002
@@ -19,6 +19,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
@@ -122,16 +123,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.2.6.1 ===
--- 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	Thu Oct 24 06:07:21 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.4 => 1.4.6.1 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/ViewMeta.py:1.4	Thu Jun 20 16:00:27 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/ViewMeta.py	Thu Oct 24 06:07:21 2002
@@ -130,7 +130,7 @@
             callable = handler,
             args = ('Views','setDefaultViewName', self.for_, self.type, name),
             )]
-        
+    
 
     def _factory(self, _context, factory):
 
@@ -272,11 +272,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.6.4 => 1.5.6.5 ===
--- Zope3/lib/python/Zope/App/Publisher/Browser/metaConfigure.py:1.5.6.4	Tue Oct 22 06:13:27 2002
+++ Zope3/lib/python/Zope/App/Publisher/Browser/metaConfigure.py	Thu Oct 24 06:07:21 2002
@@ -58,7 +58,9 @@
         Action(
         discriminator = None,
         callable = handler,
-        args = ('Interfaces', 'provideInterface', for_.__module__+'.'+for_.__name__,for_)
+        args = ('Interfaces', 'provideInterface',
+                for_.__module__+'.'+for_.__name__,
+                for_)
               )
         )