[Zope-Checkins] CVS: Zope2 - ObjectManager.py:1.129
Brian Lloyd
brian@digicool.com
Mon, 26 Mar 2001 14:52:32 -0500 (EST)
Update of /cvs-repository/Zope2/lib/python/OFS
In directory korak:/home/brian/temp/mainline_test/lib/python/OFS
Modified Files:
ObjectManager.py
Log Message:
Merged fix for finding SOFTWARE_HOME import files
--- Updated File ObjectManager.py in package Zope2 --
--- ObjectManager.py 2001/03/01 15:59:59 1.128
+++ ObjectManager.py 2001/03/26 19:52:31 1.129
@@ -536,9 +536,15 @@
dirname, file=os.path.split(file)
if dirname:
raise 'Bad Request', 'Invalid file name %s' % file
- for impath in (INSTANCE_HOME, SOFTWARE_HOME):
- file=os.path.join(impath, 'import', file)
- if os.path.exists(file):
+
+ instance_home = INSTANCE_HOME
+ software_home = os.path.join(SOFTWARE_HOME, '..%s..' % os.sep)
+ software_home = os.path.normpath(software_home)
+
+
+ for impath in (instance_home, software_home):
+ filepath = os.path.join(impath, 'import', file)
+ if os.path.exists(filepath):
break
else:
raise 'Bad Request', 'File does not exist: %s' % file
@@ -550,7 +556,7 @@
obj=obj.aq_parent
connection=obj._p_jar
ob=connection.importFile(
- file, customImporters=customImporters)
+ filepath, customImporters=customImporters)
if REQUEST: self._verifyObjectPaste(ob, validate_src=0)
#id=ob.getId()
#can't use above getId() call, it fails on 'old' exported objects