Skip to content

Commit

Permalink
Correctly handle metadata in JSON templates
Browse files Browse the repository at this point in the history
The dict will be copied as is rather than transformed into a list.

Closes yskoht#93
  • Loading branch information
hupfdule committed Jul 1, 2023
1 parent 22b235d commit b6af6bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keymapviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __legends(self, keymap):
def __json_format(self, json_, keymap):
legends = self.__legends(keymap)
ret = [[_.format(*legends) if isinstance(_, str) else _ for _ in __]
for __ in json_]
if isinstance(__, list) else __ for __ in json_]
with io.StringIO() as sio:
json.dump(ret, sio, indent=4)
ret_str = sio.getvalue()
Expand Down

0 comments on commit b6af6bc

Please sign in to comment.