Skip to main content

Logs params given to Plover steno engine hooks

Project description

Plover Steno Engine Hooks Logger

Build Status PyPI - Version PyPI - Downloads linting: pylint

Plover uses Engine Hooks to allow plugins to listen to its steno engine events. This hybrid extension/GUI Tool plugin simply connects into all the known Engine Hooks, and logs out the given parameters to the Plover log, which can be handy during Plover plugin development.

Install

Pre-Plover Plugin Registry inclusion (Current)

git clone git@github.com:paulfioravanti/plover-steno-engine-hooks-logger.git
cd plover-steno-engine-hooks-logger
plover --script plover_plugins install --editable .

Where plover in the command is a reference to your locally installed version of Plover. See the Invoke Plover from the command line page for details on how to create that reference.

Then:

  1. When it finishes installing, restart Plover
  2. Open the Plover Configuration screen (either click the Configuration icon, or from the main Plover application menu, select Preferences...)
  3. Open the Plugins tab
  4. Check the box next to plover_steno_engine_hooks to activate the plugin
  5. Click the Steno Engine Hooks Logger button on the Plover UI to enable UI-related logging.

Post-Plover Plugin Registry inclusion (Future)

  1. In the Plover application, open the Plugins Manager (either click the Plugins Manager icon, or from the Tools menu, select Plugins Manager).
  2. From the list of plugins, find plover-steno-engine-hooks
  3. Click "Install/Update"
  4. When it finishes installing, restart Plover
  5. After re-opening Plover, open the Configuration screen (either click the Configuration icon, or from the main Plover application menu, select Preferences...)
  6. Open the Plugins tab
  7. Check the box next to plover_steno_engine_hooks to activate the plugin
  8. Click the Steno Engine Hooks Logger button on the Plover UI to enable UI-related logging.

Usage

Since both the Extension and GUI Tool logging cover the same ground, you will likely only want to have one open at a single time (depending on what kind of plugin you are developing), otherwise the logs will get very noisy.

To view the logs, open up plover.log, located under your Plover configuration directory:

  • Windows: C:\Users\<your username>\AppData\Local\plover
  • macOS: ~/Library/Application Support/plover
  • Linux: ~/.config/plover

There, you should see entries there prefixed with [STENO ENGINE HOOK (EXTENSION)] or [STENO ENGINE HOOK (GUI)].

If you ever find the logs getting too noisy, then comment out any of the hooks you don't need to listen to in the _HOOKS list under the Logger class.

Development

Clone from GitHub with git and install test-related dependencies with pip:

git clone git@github.com:paulfioravanti/plover-steno-engine-hooks-logger.git
cd plover-steno-engine-hooks-logger
python -m pip install --editable ".[test]"

If you are a Tmuxinator user, you may find my plover_steno_engine_hooks_logger project file of reference.

Python Version

Plover's Python environment currently uses version 3.9 (see Plover's workflow_context.yml to confirm the current version).

So, in order to avoid unexpected issues, use your runtime version manager to make sure your local development environment also uses Python 3.9.x.

Type Checking and Linting

Since the only parts of the plugin able to be tested are ones that do not rely directly on Plover, automated testing has not been possible. But, at least there are some code quality checks performed:

  • Pylint is used for code quality
  • Mypy is used for static type checking

Run type checking and linting with the following commands:

pylint plover_steno_engine_hooks_logger
mypy plover_steno_engine_hooks_logger

If you are a just user, you may find the justfile useful during development in running multiple test commands. You can run the following command from the project root directory:

just

Deploying Changes

After making any code changes, install the plugin into Plover with the following command:

plover --script plover_plugins install --editable .

When necessary, the plugin can be uninstalled via the command line with the following command:

plover --script plover_plugins uninstall plover-steno-engine-hooks-logger

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plover_steno_engine_hooks_logger-0.3.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file plover_steno_engine_hooks_logger-0.3.0.tar.gz.

File metadata

File hashes

Hashes for plover_steno_engine_hooks_logger-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0873f248cc37043ec1efbac8287a4d6abe453301a978dda4f7369bcf4448a897
MD5 682ed3fb8c607eec728bc8b8dfb214ff
BLAKE2b-256 0bf4863d79ee6cf737f9db0436d0fb4221c9a485a75de0e8db3bb9768417ac6c

See more details on using hashes here.

File details

Details for the file plover_steno_engine_hooks_logger-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plover_steno_engine_hooks_logger-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 708eea968de83185a434c0f77e3c97399ace6cfa8d288dac5475f9bafb6e6055
MD5 e67f986896a544bc1a3a5bd26a362803
BLAKE2b-256 b8fc5e4a1c1bcc4aa621cf0ece441d6de7f1622fe716ecbcabf8a6578df75dee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page