Update of /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks
In directory sc8-pr-cvs1:/tmp/cvs-serv26638/Modeling/ModelMasons/Python_bricks
Modified Files:
init_base.tmpl module_base.tmpl
Log Message:
Fixed bug #839231: python code generated in -B/--base mode made it
impossible to import a class having sub-classes at first (circular imports)
Index: init_base.tmpl
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks/init_base.tmpl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** init_base.tmpl 26 May 2003 15:44:48 -0000 1.2
--- init_base.tmpl 15 Nov 2003 13:26:27 -0000 1.3
***************
*** 3,7 ****
# WARNING: Any changes made here will be OVERWRITTEN next time the package
# is regenerated
- #for entities in $entitiesSet:
- import $(entities[0].moduleName())
- #end for
--- 3,4 ----
Index: module_base.tmpl
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelMasons/Python_bricks/module_base.tmpl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** module_base.tmpl 6 Sep 2003 11:48:05 -0000 1.5
--- module_base.tmpl 15 Nov 2003 13:26:28 -0000 1.6
***************
*** 1,5 ****
## This template will build the module
#import time
! import $(base_dir)
# Generated by mdl_generate_python_code.py / $(time.strftime("%Y/%m/%d %H:%M"))
from Modeling.Validation import ValidationException
--- 1,11 ----
## This template will build the module
#import time
!
! #for entity in $entities:
! #set $class_name = $entity.className()
! #set $module_name = $entity.moduleName()
! from $(base_dir).$(module_name) import $(class_name) as $(base_dir)_$(module_name)_$(class_name)
! #end for
!
# Generated by mdl_generate_python_code.py / $(time.strftime("%Y/%m/%d %H:%M"))
from Modeling.Validation import ValidationException
***************
*** 13,19 ****
$entity_props.sort(lambda x,y: cmp(x.name(), y.name()))
#if $entity.parentEntity():
! class $(class_name)($(base_dir).$(module_name).$(class_name)): #derive from $(entity.parentEntity().className())
#else
! class $(class_name)($(base_dir).$(module_name).$(class_name)):
#end if
"""
--- 19,25 ----
$entity_props.sort(lambda x,y: cmp(x.name(), y.name()))
#if $entity.parentEntity():
! class $(class_name)($(base_dir)_$(module_name)_$(class_name)): #derive from $(entity.parentEntity().className())
#else
! class $(class_name)($(base_dir)_$(module_name)_$(class_name)):
#end if
"""
***************
*** 26,30 ****
# every parameter gets a default value, since the framework needs to be
# able to instanciate an object with no parameter at all.
! $(base_dir).$(module_name).$(class_name).__init__(self)
for k,v in kw.items():
self.takeValueForKey(v, k)
--- 32,36 ----
# every parameter gets a default value, since the framework needs to be
# able to instanciate an object with no parameter at all.
! $(base_dir)_$(module_name)_$(class_name).__init__(self)
for k,v in kw.items():
self.takeValueForKey(v, k)
|