[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - fileresource.py:1.3.4.1 globalbrowsermenuservice.py:1.8.2.1 i18nresourcemeta.py:1.3.2.1 icon.py:1.3.4.1 metaconfigure.py:1.2.4.1 resourcemeta.py:1.4.4.1 resources.py:1.3.2.1 viewmeta.py:1.10.2.1

Sidnei da Silva sidnei@x3ng.com.br
Tue, 11 Feb 2003 09:41:56 -0500


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv18615/src/zope/app/publisher/browser

Modified Files:
      Tag: paris-copypasterename-branch
	fileresource.py globalbrowsermenuservice.py 
	i18nresourcemeta.py icon.py metaconfigure.py resourcemeta.py 
	resources.py viewmeta.py 
Log Message:
Updating from HEAD to make sure everything still works before merging

=== Zope3/src/zope/app/publisher/browser/fileresource.py 1.3 => 1.3.4.1 ===
--- Zope3/src/zope/app/publisher/browser/fileresource.py:1.3	Sat Dec 28 11:14:00 2002
+++ Zope3/src/zope/app/publisher/browser/fileresource.py	Tue Feb 11 09:41:24 2003
@@ -39,8 +39,7 @@
 
     def browserDefault(self, request):
         '''See interface IBrowserPublisher'''
-        method = request.get('REQUEST_METHOD', 'GET').upper()
-        return getattr(self, method), ()
+        return getattr(self, request.method), ()
 
     #
     ############################################################


=== Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py 1.8 => 1.8.2.1 ===
--- Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py:1.8	Tue Dec 31 06:29:48 2002
+++ Zope3/src/zope/app/publisher/browser/globalbrowsermenuservice.py	Tue Feb 11 09:41:24 2003
@@ -21,6 +21,8 @@
 from zope.configuration.interfaces import INonEmptyDirective
 from zope.configuration.interfaces import ISubdirectiveHandler
 
+from zope.component.servicenames import Interfaces
+
 from zope.security.checker import CheckerPublic
 from zope.security.management import getSecurityManager
 
@@ -187,7 +189,7 @@
             Action(
               discriminator = None,
               callable = handler,
-              args = ('Interfaces', 'provideInterface',
+              args = (Interfaces, 'provideInterface',
                       self.interface.__module__+'.'+self.interface.__name__,
                       self.interface)
               )


=== Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py 1.3 => 1.3.2.1 ===
--- Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py:1.3	Mon Dec 30 21:52:01 2002
+++ Zope3/src/zope/app/publisher/browser/i18nresourcemeta.py	Tue Feb 11 09:41:24 2003
@@ -25,6 +25,8 @@
 from zope.configuration.action import Action
 from zope.configuration.exceptions import ConfigurationError
 
+from zope.component.servicenames import ResourceService
+
 from zope.publisher.interfaces.browser import IBrowserPresentation
 
 from zope.app.component.metaconfigure import handler
@@ -113,7 +115,7 @@
                 discriminator = ('i18n-resource', self.name, self.type,
                                  self.layer),
                 callable = handler,
-                args = ('Resources', 'provideResource', self.name, self.type,
+                args = (ResourceService, 'provideResource', self.name, self.type,
                         factory, self.layer)
                 )
             ]


=== Zope3/src/zope/app/publisher/browser/icon.py 1.3 => 1.3.4.1 ===
--- Zope3/src/zope/app/publisher/browser/icon.py:1.3	Sat Dec 28 12:49:30 2002
+++ Zope3/src/zope/app/publisher/browser/icon.py	Tue Feb 11 09:41:24 2003
@@ -26,6 +26,7 @@
 from zope.app.traversing.namespace import getResourceInContext
 from zope.publisher.interfaces.browser import IBrowserPresentation
 from zope.configuration.exceptions import ConfigurationError
+from zope.component.servicenames import Interfaces
 
 __metaclass__ = type
 
@@ -103,7 +104,7 @@
         Action(
         discriminator = None,
         callable = handler,
-        args = ('Interfaces', 'provideInterface',
+        args = (Interfaces, 'provideInterface',
                 for_.__module__+'.'+for_.__name__,
                 for_)
         )


=== Zope3/src/zope/app/publisher/browser/metaconfigure.py 1.2 => 1.2.4.1 ===
--- Zope3/src/zope/app/publisher/browser/metaconfigure.py:1.2	Wed Dec 25 09:13:09 2002
+++ Zope3/src/zope/app/publisher/browser/metaconfigure.py	Tue Feb 11 09:41:24 2003
@@ -19,6 +19,7 @@
 from zope.configuration.action import Action
 
 from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.component.servicenames import Interfaces
 
 from zope.app.component.metaconfigure \
      import defaultView as _defaultView, skin as _skin, handler
@@ -58,7 +59,7 @@
         Action(
         discriminator = None,
         callable = handler,
-        args = ('Interfaces', 'provideInterface',
+        args = (Interfaces, 'provideInterface',
                 for_.__module__+'.'+for_.__name__,
                 for_)
               )


=== Zope3/src/zope/app/publisher/browser/resourcemeta.py 1.4 => 1.4.4.1 ===
--- Zope3/src/zope/app/publisher/browser/resourcemeta.py:1.4	Sat Dec 28 11:14:00 2002
+++ Zope3/src/zope/app/publisher/browser/resourcemeta.py	Tue Feb 11 09:41:24 2003
@@ -21,6 +21,8 @@
 from zope.configuration.action import Action
 from zope.configuration.exceptions import ConfigurationError
 
+from zope.component.servicenames import ResourceService
+
 from zope.publisher.interfaces.browser import IBrowserPresentation
 
 from zope.app.component.metaconfigure import handler
@@ -54,7 +56,7 @@
         Action(
             discriminator = ('resource', name, IBrowserPresentation, layer),
             callable = handler,
-            args = ('Resources', 'provideResource',
+            args = (ResourceService, 'provideResource',
                     name, IBrowserPresentation, factory, layer),
             )
         ]


=== Zope3/src/zope/app/publisher/browser/resources.py 1.3 => 1.3.2.1 ===
--- Zope3/src/zope/app/publisher/browser/resources.py:1.3	Sat Jan 25 08:19:25 2003
+++ Zope3/src/zope/app/publisher/browser/resources.py	Tue Feb 11 09:41:24 2003
@@ -20,6 +20,7 @@
 from zope.publisher.browser import BrowserView
 from zope.publisher.interfaces.browser import IBrowserPublisher
 from zope.component import getService
+from zope.component.servicenames import ResourceService
 from zope.proxy.context import ContextWrapper
 from zope.proxy.context import ContextMethod
 from zope.exceptions import NotFoundError
@@ -33,7 +34,7 @@
     def publishTraverse(wrapped_self, request, name):
         '''See interface IBrowserPublisher'''
 
-        resource_service = getService(wrapped_self, 'Resources')
+        resource_service = getService(wrapped_self, ResourceService)
         resource = resource_service.queryResource(wrapped_self, name, request)
         if resource is None:
             raise NotFoundError(wrapped_self, name)


=== Zope3/src/zope/app/publisher/browser/viewmeta.py 1.10 => 1.10.2.1 ===
--- Zope3/src/zope/app/publisher/browser/viewmeta.py:1.10	Mon Feb  3 11:34:37 2003
+++ Zope3/src/zope/app/publisher/browser/viewmeta.py	Tue Feb 11 09:41:24 2003
@@ -29,6 +29,8 @@
 from zope.configuration.action import Action
 from zope.configuration.exceptions import ConfigurationError
 
+from zope.component.servicenames import Interfaces
+
 from zope.publisher.interfaces.browser import IBrowserPresentation
 from zope.publisher.interfaces.browser import IBrowserPublisher
 
@@ -315,11 +317,17 @@
         cdict['publishTraverse'] = publishTraverse
 
         if not hasattr(class_, 'browserDefault'):
-            default = self.default or self.pages[0][0]
-            cdict['browserDefault'] = (
-                lambda self, request, default=default:
-                (self, (default, ))
-                )
+            if self.default or self.pages:
+                default = self.default or self.pages[0][0]
+                cdict['browserDefault'] = (
+                    lambda self, request, default=default:
+                    (self, (default, ))
+                    )
+            elif providesCallable(class_):
+                cdict['browserDefault'] = (
+                    lambda self, request: (self, ())
+                    )
+                
 
         if class_ is not None:
             bases = (class_, simple)
@@ -390,7 +398,7 @@
             Action(
             discriminator = None,
             callable = handler,
-            args = ('Interfaces', 'provideInterface',
+            args = (Interfaces, 'provideInterface',
                     for_.__module__+'.'+for_.__name__,
                     for_)
             )
@@ -429,7 +437,7 @@
             i = _context.resolve(i)
             actions .append(
                 Action(discriminator = None, callable = handler,
-                       args = ('Interfaces', 'provideInterface', None, i)
+                       args = (Interfaces, 'provideInterface', None, i)
                        ))
             for name in i:
                 required[name] = permission
@@ -450,7 +458,7 @@
 
         actions .append(
             Action(discriminator = None, callable = handler,
-                   args = ('Interfaces', 'provideInterface', None, for_)
+                   args = (Interfaces, 'provideInterface', None, for_)
             ))
 
     return for_
@@ -471,3 +479,10 @@
 
         meth = getattr(self, attr)
         return meth(*a, **k)
+
+def providesCallable(class_):
+    if hasattr(class_, '__call__'):
+        for c in class_.__mro__:
+            if '__call__' in c.__dict__:
+                return True
+    return False