Update of /cvsroot/webware/Webware/MiddleKit/Design
In directory usw-pr-cvs1:/tmp/cvs-serv4868
Modified Files:
PythonGenerator.py
Log Message:
fixed misdirected import code generation that erroneously related to the cur work dir rather than the cur python file dir
Index: PythonGenerator.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Design/PythonGenerator.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PythonGenerator.py 2001/09/29 02:18:28 1.11
--- PythonGenerator.py 2001/12/27 05:57:01 1.12
***************
*** 127,133 ****
if pkg:
pkg += '.'
! backPath = repr('../' * (pkg.count('.')+1))
wr('''\
import sys
sys.path.insert(0, %(backPath)s)
from %(pkg)s%(supername)s import %(supername)s
--- 127,137 ----
if pkg:
pkg += '.'
! #backPath = repr('../' * (pkg.count('.')+1))
! backPath = 'dirname(__file__)'
! for i in xrange(pkg.count('.')+1):
! backPath = 'dirname(%s)' % backPath
wr('''\
import sys
+ from os.path import dirname
sys.path.insert(0, %(backPath)s)
from %(pkg)s%(supername)s import %(supername)s
|