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 committed 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 want to integrate support for psycopg2 into the framework (checking that the tests run ok etc.) feel free to contact me directly; even if I have almost no time to make the project evolve I may still be able to point you in the right direction!-)
-- Sébastien.
As per http://modeling.svn.sourceforge.net/viewvc/modeling/trunk/ProjectModeling/Modeling/scripts/mdl_generate_python_code.py?r1=961&r2=1004&pathrev=1004&diff_format=u
--- 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,DEBUG
errors=MV.ModelValidationException(ignore_levels=[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)")
bds...@kn... a écrit :
> 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
|