Extend fix in mdl_generate_DB_schema.py to mdl_generate_python_code.py

James Laska <[email protected]> Fri, 10 Jun 2005 12:59:01 -0400
Newsgroups gmane.comp.python.modeling
Message-ID <[email protected]>
Greetings,

In order to get mdl_generate_python_code.py to work for a valid xml
input, I needed to extend the fix provided in the url below:

https://sourceforge.net/mailarchive/message.php?msg_id=3D9657727

The additional fix is as follows:

Index: Modeling/scripts/mdl_generate_python_code.py
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/scripts/mdl_generate_p=
ython_code.py,v
retrieving revision 1.11
diff -u -r1.11 mdl_generate_python_code.py
--- Modeling/scripts/mdl_generate_python_code.py        30 Nov 2004
17:25:35 -0000      1.11
+++ Modeling/scripts/mdl_generate_python_code.py        10 Jun 2005
16:55:10 -0000
@@ -178,7 +178,7 @@
   from Modeling.ModelValidation import NOT_SUPPORTED,ERROR,WARNING,INFO,DE=
BUG
   errors=3DMV.ModelValidationException(ignore_levels=3D[DEBUG,INFO,WARNING=
])
   MV.validateModel(model, errors)
-  if errors:
+  if errors.has_errors():
     log("Error: model has errors")
     if verbose: log(str(errors))
     else: log("(-v for details)")

This appears to resolve the issue for me.  Thanks to Lorenzo Gil
Sanchez for the original fix.
James Laska


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20