Update of /cvsroot/modeling/ProjectModeling/Modeling/tests/testPackages/AuthorBooks
In directory sc8-pr-cvs1:/tmp/cvs-serv4163/Modeling/tests/testPackages/AuthorBooks
Modified Files:
__init__.py
Log Message:
Changed: ready to accept pymodel as well
Index: __init__.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/testPackages/AuthorBooks/__init__.py,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** __init__.py 30 Jul 2002 15:38:54 -0000 1.1.1.1
--- __init__.py 31 Jul 2003 20:54:40 -0000 1.2
***************
*** 1,18 ****
# Load the model
! from Modeling import ModelSet
! import os, warnings, StringIO, traceback
! try:
! if ModelSet.defaultModelSet().modelNamed("AuthorBooks") is None:
! from os import getcwd, path
! mydir = os.path.abspath(os.path.dirname(__file__))
! xmlmodelPath=path.join(mydir,'model_AuthorBooks.xml')
! ModelSet.defaultModelSet().addModelFromXML({'file': xmlmodelPath})
! model=ModelSet.defaultModelSet().modelNamed('AuthorBooks')
! except:
! exc=StringIO.StringIO()
! traceback.print_exc(file=exc)
! warnings.warn("Couldn't load model 'model_AuthorBooks.xml'\nReason:\n%s"%exc.getvalue())
! del exc
! del os, warnings, StringIO, traceback
--- 1,14 ----
# Load the model
! from Modeling import ModelSet, Model
! if ModelSet.defaultModelSet().modelNamed("AuthorBooks") is None:
! import os
! mydir = os.path.abspath(os.path.dirname(__file__))
! model=Model.searchModel('AuthorBooks', mydir, verbose=0)
!
! if not model:
! import warnings
! warnings.warn("Couldn't load model 'AuthorBooks'")
! else:
! ModelSet.defaultModelSet().addModel(model)
|