brettviren / moo

ruminants on module oriented programming
GNU General Public License v3.0
4 stars 4 forks source link

Inconsistent handling of file load path. #9

Closed brettviren closed 3 years ago

brettviren commented 3 years ago

The MOO_MODEL_PATH is handled a little inconsistently. The CLI will apply it as part of -M arg handling universally but when moo Python is used it is not always applied. moo.otypes.load_types() applies it but equivalent in moo.oschema does not.

Fall back to a path from an env var should be applied lower down in moo.io.

As part of this, the name MODEL is not well suited and something like MOO_LOAD_PATH may be substituted.

brettviren commented 3 years ago

The MOO_TEMPLATE_PATH is only applied at CLI layer.

brettviren commented 3 years ago

With input from Ale: use of env. vars. will be pushed to the CLI layer and use of moo through its Python modules will not be subject to env vars. Both CLI and application may call a common function (to be added) to set the fallback path.