Skip to content

Optional method to export dictionary to JSON using Plover's "save as" feature? #9

@user202729

Description

@user202729

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 ()
			raise ValueError("Dictionary does not support exporting!")
		items = mod.get('items', _default_items)
		if not isinstance(items, typing.Callable):
			raise ValueError('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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions