[CMF-checkins] CVS: CMF - DynamicType.py:1.4.2.3 utils.py:1.5.2.2

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


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

Modified Files:
      Tag: CMF-1_0-branch
	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:06:12	1.4.2.2
+++ DynamicType.py	2001/04/10 17:29:29	1.4.2.3
@@ -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/09 15:48:00	1.5.2.1
+++ utils.py	2001/04/10 17:29:29	1.5.2.2
@@ -97,13 +97,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: