[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/TraversalViews - AbsoluteURL.py:1.5.6.1
Deb
dhazarika@zeomega.com
Fri, 25 Oct 2002 06:30:17 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/TraversalViews
In directory cvs.zope.org:/tmp/cvs-serv1313/lib/python/Zope/App/ZopePublication/TraversalViews
Modified Files:
Tag: Zope3-Bangalore-TTW-Branch
AbsoluteURL.py
Log Message:
updated to support introspector
=== Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/AbsoluteURL.py 1.5 => 1.5.6.1 ===
--- Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/AbsoluteURL.py:1.5 Sat Jul 13 10:18:37 2002
+++ Zope3/lib/python/Zope/App/ZopePublication/TraversalViews/AbsoluteURL.py Fri Oct 25 06:30:17 2002
@@ -19,7 +19,7 @@
from Zope.Publisher.Browser.BrowserView import BrowserView
from Zope.Proxy.ContextWrapper import getWrapperContainer, getInnerWrapperData
from Zope.ComponentArchitecture import getView
-
+import string
from Interface import Interface
class IAbsoluteURL(Interface):
@@ -55,14 +55,15 @@
__call__ = __str__
def breadcrumbs(self):
- context = self.context
+ context = self.context
dict = getInnerWrapperData(context)
name = dict and dict.get('name') or None
- container = getWrapperContainer(context)
+ container = getWrapperContainer(context)
+ base =()
if name is None or container is None:
raise TypeError, 'Not enough context information to get a URL'
- if name == '.':
+ if name == '.':
# The name is meaningless. There is a side-efect name
# that we need to preserve in the urls (only)
name = dict.get('side_effect_name', name)
@@ -75,10 +76,11 @@
'name': base[-1]['name'],
'url': ("%s/%s" % (base[-1]['url'], name)),
}, )
- return base
-
- base = getView(container, 'absolute_url', self.request).breadcrumbs()
- base += ({'name': name, 'url': ("%s/%s" % (base[-1]['url'], name))}, )
+ return base
+
+ if string.find(name,'++module++')==-1:
+ base = getView(container, 'absolute_url', self.request).breadcrumbs()
+ base += ({'name': name, 'url': ("%s/%s" % (base[-1]['url'], name))}, )
return base
@@ -101,7 +103,7 @@
__call__ = __str__
def breadcrumbs(self):
- context = self.context
+ context = self.context
dict = getInnerWrapperData(context)
name = dict and dict.get('name') or None
if name:
@@ -118,7 +120,6 @@
{'name': base[-1]['name'],
'url': ("%s/%s" % (base[-1]['url'], name))}, )
return base
-
return ({'name':'', 'url': self.request.getApplicationURL()}, )