You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may be useful to allow exporting a Python dictionary to a JSON file.
I think a possible implementation is something like:
def_default_items():
return ()
raiseValueError("Dictionary does not support exporting!")
items=mod.get('items', _default_items)
ifnotisinstance(items, typing.Callable):
raiseValueError('invalid `items\' function: %s\n'%items)
self._items=items
then the Python file, if it wants, can define a items function that returns an iterable of (stroke, value): (str, str) objects.
Motivation: my library https://github.com/user202729/plover-python-dictionary-lib/ supports exporting to JSON, but it would be better to allow doing that inside Plover's GUI itself, so user who are not familiar with the CLI would find it easier.
The text was updated successfully, but these errors were encountered:
It may be useful to allow exporting a Python dictionary to a JSON file.
I think a possible implementation is something like:
then the Python file, if it wants, can define a
items
function that returns an iterable of(stroke, value): (str, str)
objects.Motivation: my library https://github.com/user202729/plover-python-dictionary-lib/ supports exporting to JSON, but it would be better to allow doing that inside Plover's GUI itself, so user who are not familiar with the CLI would find it easier.
The text was updated successfully, but these errors were encountered: