[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL - AbsoluteURL.py:1.1.2.4.4.2

Jim Fulton jim@zope.com
Sun, 2 Jun 2002 10:35:26 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL
In directory cvs.zope.org:/tmp/cvs-serv29793/lib/python/Zope/App/ZopePublication/AbsoluteURL

Modified Files:
      Tag: Zope3InWonderland-branch
	AbsoluteURL.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/ZopePublication/AbsoluteURL/AbsoluteURL.py 1.1.2.4.4.1 => 1.1.2.4.4.2 ===
 $Id$
 """
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
+from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.Proxy.ContextWrapper import getWrapperContainer, getWrapperData
 from Zope.ComponentArchitecture import getView
 
-class AbsoluteURL:
-
-    __implements__ = IBrowserPublisher
-
-    def __init__(self, context, request):
-        self.__context = context
-        self.__request = request
+class AbsoluteURL(BrowserView):
 
     def __str__(self):
-        context = self.__context
+        context = self.context
         dict = getWrapperData(context)
         name = dict and dict.get('name') or None
         container = getWrapperContainer(context)
         if name is None or container is None:
             raise TypeError, 'Not enough context information to get a URL'
 
-        return "%s/%s" % (getView(container, 'absolute_url', self.__request),
+        return "%s/%s" % (getView(container, 'absolute_url', self.request),
                           name)
 
     __call__ = __str__
 
 
-class SiteAbsoluteURL:
-
-    __implements__ = IBrowserPublisher
-
-    def __init__(self, context, request):
-        self.__context = context
-        self.__request = request
+class SiteAbsoluteURL(BrowserView):
 
     def __str__(self):
-        return self.__request.getApplicationURL()
+        return self.request.getApplicationURL()
 
     __call__ = __str__