Update of /cvsroot/webware/Webware/WebKit
In directory usw-pr-cvs1:/tmp/cvs-serv19506
Modified Files:
Application.py
Log Message:
fixed a bug in the context initialization code, .addContext(), that was silently
hiding ImportErrors that occurred inside a context's __init__.py module.
Index: Application.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/Application.py,v
retrieving revision 1.140
retrieving revision 1.141
diff -C2 -d -r1.140 -r1.141
*** Application.py 11 Aug 2002 15:10:20 -0000 1.140
--- Application.py 18 Sep 2002 07:00:15 -0000 1.141
***************
*** 825,828 ****
--- 825,829 ----
print 'WARNING: Overwriting context %s (=%s) with %s' % (
repr(name), repr(self._contexts[name]), repr(dir))
+ __init__fileFound = 0
try:
importAsName = name
***************
*** 831,840 ****
res = imp.find_module(pkgname, [localdir])
mod = imp.load_module(name, res[0], res[1], res[2])
! if mod.__dict__.has_key('contextInitialize'):
! result = mod.__dict__['contextInitialize'](self, os.path.normpath(os.path.join(os.getcwd(),dir)))
! if result != None and result.has_key('ContentLocation'):
! dir = result['ContentLocation']
except ImportError:
pass
print 'Loading context: %s at %s' % (name, dir)
self._contexts[name] = dir
--- 832,844 ----
res = imp.find_module(pkgname, [localdir])
mod = imp.load_module(name, res[0], res[1], res[2])
! __init__fileFound = 1
except ImportError:
pass
+
+ if __init__fileFound and mod.__dict__.has_key('contextInitialize'):
+ result = mod.__dict__['contextInitialize'](self,
+ os.path.normpath(os.path.join(os.getcwd(),dir)))
+ if result != None and result.has_key('ContentLocation'):
+ dir = result['ContentLocation']
print 'Loading context: %s at %s' % (name, dir)
self._contexts[name] = dir
|