Skip to content

Commit

Permalink
change of basename to name in returned object (from list_templates)
Browse files Browse the repository at this point in the history
Use of name in matching templates.
  • Loading branch information
david-i-berry committed Feb 14, 2024
1 parent f5f1d08 commit c192a86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions csv2bufr/templates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def load_template(template_name: str) -> Union[dict, None]:
msg = f"Requested template {template_name} not found, " +\
"searching by file name"
for _template in TEMPLATES.values():
if template_name in _template.get('path'):
if template_name == _template.get('name'):
fname = _template.get('path')
break
if fname is None:
Expand Down Expand Up @@ -183,7 +183,7 @@ def index_templates() -> bool:
"dateCreated": tmpl['metadata'].get("dateCreated", ""), # noqa
"id": tmpl['metadata'].get("id", ""),
"path": fname,
"basename": Path(fname).name.replace(".json", "") # noqa
"name": Path(fname).name.replace(".json", "") # noqa
}

except Exception as e:
Expand Down

0 comments on commit c192a86

Please sign in to comment.