Re: mdl_generate_python_code reports errors on a correct model
Sébastien Bigaret <[email protected]> Mon, 20 Jul 2009 09:40:27 +0200
| Newsgroups | gmane.comp.python.modeling |
|---|---|
| Message-ID | <[email protected]> |
Hi Bernard,
You're absolutely right, we have a stupid bug here, introduced in rev.944.
You'll find the simple patch below, fixing the problem (this has been commi=
tted into the trunk, rev.1004)
Thanks for reporting.
> Running mdl_validate_model.py sample_pymodel.py now gave no errors, but
> returned nothing. I'm assuming that is following the unix philosophy of
> being silent when there is nothing to report.
Exactly: the return status is the only element indicating whether an error =
occured unless -v is specified.
I'm happy to see a new person here coming from the WO/EO world. If you wan=
t to integrate support for psycopg2 into the framework (checking that the t=
ests run ok etc.) feel free to contact me directly; even if I have almost n=
o time to make the project evolve I may still be able to point you in the r=
ight direction!-)
-- S=E9bastien.
As per http://modeling.svn.sourceforge.net/viewvc/modeling/trunk/ProjectMod=
eling/Modeling/scripts/mdl_generate_python_code.py?r1=3D961&r2=3D1004&pathr=
ev=3D1004&diff_format=3Du
--- trunk/ProjectModeling/Modeling/scripts/mdl_generate_python_code.py 2004=
/11/30 17:25:35 961
+++ trunk/ProjectModeling/Modeling/scripts/mdl_generate_python_code.py 2009=
/07/20 07:34:12 1004
@@ -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)")
[email protected] a =E9crit :
> When I run the validation check on the sample_model.py, it will validate =
OK.
> =
> =
> bernard@li4-106:~/tmp> mdl_validate_model.py -v sample_pymodel.py
> Loading the model...
> Done.
> Validating...
> Done.
> =
> However, when I then try to generate the python classes from it, I get
> reports of errors:
> =
> bernard@li4-106:~/tmp> mdl_generate_python_code.py -v sample_pymodel.py
> Loading the model...
> Error: model has errors
> =
> Aborting
> =
> I can't find any information on what those errors might be.
> =
> Bernard
---------------------------------------------------------------------------=
---
Enter the BlackBerry Developer Challenge =
This is your chance to win up to $100,000 in prizes! For a limited time, =
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize=
=
details at: http://p.sf.net/sfu/Challenge