[CMF-checkins] CVS: CMF/CMFDefault/skins/zpt_generic - breadcrumbs.py:1.4

Yvo Schubbe cvs-admin at zope.org
Mon Dec 1 08:56:15 EST 2003


Update of /cvs-repository/CMF/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv16302/CMFDefault/skins/zpt_generic

Modified Files:
	breadcrumbs.py 
Log Message:
some code modernization:
- death to string module
- death to apply
- import and whitespace cleanup


=== CMF/CMFDefault/skins/zpt_generic/breadcrumbs.py 1.3 => 1.4 ===
--- CMF/CMFDefault/skins/zpt_generic/breadcrumbs.py:1.3	Tue Jun 11 09:17:21 2002
+++ CMF/CMFDefault/skins/zpt_generic/breadcrumbs.py	Mon Dec  1 08:55:45 2003
@@ -2,20 +2,21 @@
 ##parameters=include_root=1
 ##title=Return breadcrumbs
 ##
-from string import join
-
+from Products.CMFCore.utils import getToolByName
+ptool = getToolByName(script, 'portal_properties')
+utool = getToolByName(script, 'portal_url')
+portal_url = utool()
 result = []
-portal_url = context.portal_url()
 
 if include_root:
     result.append( { 'id'      : 'root'
-                   , 'title'   : context.portal_properties.title()
+                   , 'title'   : ptool.title()
                    , 'url'     : portal_url
                    }
                  )
 
-relative = context.portal_url.getRelativeContentPath( context )
-portal = context.portal_url.getPortalObject()
+relative = utool.getRelativeContentPath(context)
+portal = utool.getPortalObject()
 
 for i in range( len( relative ) ):
     now = relative[ :i+1 ]
@@ -23,7 +24,7 @@
     if not now[ -1 ] == 'talkback':
         result.append( { 'id'      : now[ -1 ]
                        , 'title'   : obj.Title()
-                       , 'url'     : portal_url + '/' + join( now, '/' )
+                       , 'url'     : portal_url + '/' + '/'.join(now)
                        }
                     )
 




More information about the CMF-checkins mailing list