[CMF-checkins] CVS: CMF/CMFCore - DirectoryView.py:1.28 utils.py:1.29

Tres Seaver tseaver@zope.com
Mon, 12 Aug 2002 08:23:14 -0400


Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv25493

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


  - Revert last week's problematic changes, after checking them in on
    a new branch ('chrisw-dirview-branch'), to keep the unittests clean
    on the HEAD while work continues on the branch.


=== CMF/CMFCore/DirectoryView.py 1.27 => 1.28 ===
--- CMF/CMFCore/DirectoryView.py:1.27	Mon Aug  5 10:23:41 2002
+++ CMF/CMFCore/DirectoryView.py	Mon Aug 12 08:23:13 2002
@@ -348,7 +348,7 @@
 
     def getDirectoryInfo(self, filepath):
         # Can return None.
-        return self._directories.get(minimalpath(filepath), None)
+        return self._directories.get(os.path.normpath(filepath), None)
 
     def listDirectories(self):
         dirs = self._directories.keys()


=== CMF/CMFCore/utils.py 1.28 => 1.29 ===
--- CMF/CMFCore/utils.py:1.28	Tue Aug  6 20:56:28 2002
+++ CMF/CMFCore/utils.py	Mon Aug 12 08:23:13 2002
@@ -629,9 +629,14 @@
 def minimalpath(p):
     # Trims INSTANCE_HOME or SOFTWARE_HOME from a path.
     p = os_path.abspath(p)
-    #abs = normalize(p)
-    p = p[p.index('Products'):]
+    abs = normalize(p)
+    l = len(normINSTANCE_HOME)
+    if abs[:l] != normINSTANCE_HOME:
+        l = len(normSOFTWARE_HOME)
+        if abs[:l] != normSOFTWARE_HOME:
+            # Can't minimize.
+            return p
+    p = p[l:]
     while p[:1] in separators:
         p = p[1:]
     return p
-