Skip to main content

plover-run-py

Command plugin for Plover to run an arbitrary Python command.

Warning: While this plugin can do everything what a command plugin can, this should only be used for personal usage. If the usage is sufficiently general, it's recommended to make a Plover command plugin instead.

It's also possible to execute a command from the command-line, using the plover_send_command script. Unfortunately, this method takes about 1.5s per call due to Plover's overhead.

If python -m plover.scripts.send_command is used, the time is reduced to 0.3s per call, mostly because of pkg_resources import.

See also

Usage

In order to use this plugin in Plover you need to create a dictionary entry of the form:

{
    "example_stroke": "{PLOVER:PY:command}"
}

Variables engine and plover are provided.

Remember to escape the characters in \{} according to Plover's dictionary format.

Alternatively, if the definition has the form "{PLOVER:PY_F:path}", the content of the file at the given path will be run as Python code.

Note: If the command takes a long time to finish, Plover might freeze.

Example

Refer to the API reference (1, 2) (unofficial, community-maintained) for more details.

  • Sleep between key presses: {#a}{plover:py:import time; time.sleep(1)}{#b}

  • Toggle a plugin and show a warning notification on the status: (broken into multiple lines for readability) See also user202729/plover-delay: Plover command plugin to sleep for some time. for a dedicated plugin.

    {plover:py:
    engine["enabled_extensions"]^=\{'ibus'\};
    plover.log.warning('ibus enabled=' + str('ibus' in engine["enabled_extensions"]))
    }
    

Release files for plover-run-py 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plover-run-py 0.0.5
File Size Uploaded
plover_run_py-0.0.5.tar.gz 16.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plover-run-py 0.0.5
File Interpreter ABI Platform
plover_run_py-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 31.6 kB

Release files / plover_run_py-0.0.5.tar.gz

Download URL plover_run_py-0.0.5.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
087f8dab2d269a7a2816c441131c9cde8d5acd23a4476df139d592e628120120
BLAKE2b-256 checksum
How to use checksums
4029304857a894b67144bf3dc47053a35e154934f35fb29b4e2c23d49d1b10cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.5

Release files / plover_run_py-0.0.5-py3-none-any.whl

Download URL plover_run_py-0.0.5-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69690aa0836d74eac07d63c94487ffb9d6eb3226db3e2236eb2bc52f8484ba7d
BLAKE2b-256 checksum
How to use checksums
b530ae3cd165388da0f82fa40e8e98faf392d6bb4d3fb976905a86b6c857cc65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page