diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-04-20 21:24:39 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-04-20 21:24:39 (GMT) |
commit | 6a87dd5cfa0a272f978e1b22ca59f1c8c55505a7 (patch) | |
tree | f7e2a8d19bd2a78fc3e516442e6d8815745c6d22 /src | |
parent | f55cd8198a84af1e80a03d8f14f190a903b58694 (diff) |
accept 'layername' and 'filename' in import, WARNING deprecation
Diffstat (limited to 'src')
-rw-r--r-- | src/import.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/import.cc b/src/import.cc index c9a2b91..927c9d8 100644 --- a/src/import.cc +++ b/src/import.cc @@ -67,6 +67,7 @@ AbstractNode *ImportModule::evaluate(const Context *ctx, const ModuleInstantiati { AssignmentList args; args += Assignment("file", NULL), Assignment("layer", NULL), Assignment("convexity", NULL), Assignment("origin", NULL), Assignment("scale", NULL); + args += Assignment("filename",NULL), Assignment("layername", NULL); // FIXME: This is broken. Tag as deprecated and fix // Map old argnames to new argnames for compatibility @@ -90,6 +91,12 @@ AbstractNode *ImportModule::evaluate(const Context *ctx, const ModuleInstantiati #endif Value v = c.lookup_variable("file"); + if (v.isUndefined()) { + v = c.lookup_variable("filename"); + if (!v.isUndefined()) + PRINT("WARNING: filename= is deprecated. Please use file="); + } + std::string filename = inst->getAbsolutePath(v.isUndefined() ? "" : v.toString()); import_type_e actualtype = this->type; if (actualtype == TYPE_UNKNOWN) { @@ -108,6 +115,11 @@ AbstractNode *ImportModule::evaluate(const Context *ctx, const ModuleInstantiati node->filename = filename; Value layerval = c.lookup_variable("layer", true); + if (layerval.isUndefined()) { + layerval = c.lookup_variable("layername",true); + if (!layerval.isUndefined()) + PRINT("WARNING: layername= is deprecated. Please use layer="); + } node->layername = layerval.isUndefined() ? "" : layerval.toString(); node->convexity = c.lookup_variable("convexity", true).toDouble(); |