[CMF-checkins] CVS: CMF - DirectoryView.py:1.7

shane@digicool.com shane@digicool.com
Sat, 14 Apr 2001 18:44:42 -0400 (EDT)


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

Modified Files:
	DirectoryView.py 
Log Message:
A little more tolerant of different kinds of setups



--- Updated File DirectoryView.py in package CMF --
--- DirectoryView.py	2001/04/10 20:10:29	1.6
+++ DirectoryView.py	2001/04/14 22:44:42	1.7
@@ -101,7 +101,8 @@
 
 __reload_module__ = 0
 
-normalize = path.normcase
+def normalize(p):
+    return path.abspath(path.normcase(p))
 
 normINSTANCE_HOME = normalize(INSTANCE_HOME)
 normSOFTWARE_HOME = normalize(SOFTWARE_HOME)
@@ -112,10 +113,10 @@
     # Converts a minimal path to an absolute path.
     if path.isabs(p):
         return p
-    abs = path.join(INSTANCE_HOME, p)
+    abs = path.join(normINSTANCE_HOME, p)
     if path.exists(abs):
         return abs
-    return path.join(SOFTWARE_HOME, p)
+    return path.join(normSOFTWARE_HOME, p)
 
 def minimalpath(p):
     # Trims INSTANCE_HOME or SOFTWARE_HOME from a path.
@@ -240,7 +241,7 @@
                 pos = rfind(entry, '.')
                 if pos >= 0:
                     name = entry[:pos]
-                    ext = normalize(entry[pos + 1:])
+                    ext = path.normcase(entry[pos + 1:])
                 else:
                     name = entry
                     ext = ''