Skip to content

Commit

Permalink
Fix fiboa converters command
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jun 17, 2024
1 parent 821fa55 commit aa605f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fiboa_cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def converters():
"""
log(f"fiboa CLI {__version__} - List of Converters\n", "success")

keys = ["TITLE", "LICENSE", "PROVIDER_NAME", "URI"]
keys = ["TITLE", "LICENSE", "PROVIDER_NAME", "SOURCES"]
converters = list_all_converters(keys)
df = pd.DataFrame.from_dict(converters, orient='index', columns=keys)

Expand Down
13 changes: 12 additions & 1 deletion fiboa_cli/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ def list_all_converters(keys):
try:
converter = read_converter(id)
for key in keys:
obj[key] = getattr(converter, key)
value = getattr(converter, key)

if key == "SOURCES":
if isinstance(value, str):
value = tuple([value])
elif isinstance(value, dict):
value = value.keys()
elif key == "LICENSE" and isinstance(value, dict):
value = value["href"]

obj[key] = value

converters[id] = obj
except ImportError:
pass
Expand Down

0 comments on commit aa605f2

Please sign in to comment.