[CMF-checkins] CVS: CMF - DynamicType.py:1.7 utils.py:1.8

tseaver@digicool.com tseaver@digicool.com
Tue, 10 Apr 2001 13:24:20 -0400 (EDT)


Update of /cvs-repository/CMF/CMFCore
In directory korak:/tmp/cvs-serv28242/CMFCore

Modified Files:
	DynamicType.py utils.py 
Log Message:


 - Make appropriate use of 'portal_url', instead of ad hockery.

 - Synch up interface definition of 'Contentish.getIcon' with
   reality.



--- Updated File DynamicType.py in package CMF --
--- DynamicType.py	2001/04/09 20:21:05	1.6
+++ DynamicType.py	2001/04/10 17:23:48	1.7
@@ -84,7 +84,7 @@
 ##############################################################################
 
 from AccessControl import ClassSecurityInfo
-from utils import getPortal, getToolByName
+from utils import getToolByName
 import Globals
 from urllib import quote
 
@@ -146,8 +146,8 @@
                     return icon
                 else:
                     # Need the full path to the icon.
-                    portal_url = getPortal(self).absolute_url(relative=1)
-                    return portal_url + '/' + icon
+                    portal_url = getToolByName( self, 'portal_url' )
+                    return portal_url() + '/' + icon
         return 'misc_/OFSP/dtmldoc.gif'
 
     security.declarePublic('icon')

--- Updated File utils.py in package CMF --
--- utils.py	2001/04/08 19:18:09	1.7
+++ utils.py	2001/04/10 17:23:48	1.8
@@ -100,13 +100,6 @@
 
 _marker = []  # Create a new marker object.
 
-def getPortal(ob):
-    # This isn't as efficient as it could be.
-    while ob is not None:
-        if getattr(ob, '_isPortalRoot', 0):
-            return ob
-        ob = aq_parent(aq_inner(ob))
-
 def getToolByName(obj, name, default=_marker):
     " Get the tool, 'toolname', by acquiring it. "
     try: