plover.config – Configuration¶
This modules handles reading and writing Plover’s configuration files, as well as updating the configuration on-the-fly while Plover is running.
- class plover.config.Config(path=None)¶
An object containing the entire Plover configuration. The config object maintains a cache for any changes that are made while Plover is running.
- load() None¶
Reads and parses the configuration from the configuration file. Raises an
InvalidConfigurationErrorif the configuration could not be parsed correctly.
- clear() None¶
Clears the configuration and returns to the base state.
- save() None¶
Writes the current state of the configuration to the configuration file.
- __getitem__(key: str) Any¶
Returns the value of the specified
keyin the cache, or in the full configuration if not available.
- __setitem__(key: str, value: Any) None¶
Sets the property
keyin the configuration to the specified value.
- as_dict() Dict[str, Any]¶
Returns the
dictrepresentation of the current state of the configuration.
- update(**kwargs) None¶
Update the cache to reflect the contents of the full configuration.
- exception plover.config.InvalidConfigOption(raw_value, fixed_value, message=None)¶
An exception raised when a configuration option has been set to an invalid value, such as one of the wrong type.
fixed_valueis the value that Plover is falling back on ifraw_valuecan’t be parsed correctly.
- class plover.config.DictionaryConfig(path, enabled=True)¶
Represents the configuration for one dictionary.
- path¶
The fully qualified path to the dictionary file.
- Type:
str
- enabled¶
Whether the dictionary is enabled.
- Type:
bool
- property short_path: str¶
The shortened path to the dictionary file. This is automatically calculated from
path.
- to_dict() Dict[str, Any]¶
Returns the
dictrepresentation of the dictionary configuration.
- replace(**kwargs) DictionaryConfig¶
Replaces the values of
pathandenabledwith those inkwargs.
- static from_dict(d: Dict[str, Any]) DictionaryConfig¶
Returns a
DictionaryConfigconstructed from itsdictrepresentation.
Configuration Options¶
Below is the list of all available configuration keys:
Output¶
- space_placement
When writing translations, whether to add spaces before or after each translation. Possible values are
Before OutputandAfter Output. By default, will add spaces before translations.
- start_attached
Whether to delete the space before the translation when the initial stroke is translated.
Falseby default.
- start_capitalized
Whether to capitalize the translation when the initial stroke is translated.
Falseby default.
- undo_levels
The maximum number of translations Plover is allowed to undo. 100 by default.
Each stroke that performs a translation is added onto an undo stack, and undo strokes (such as
*) remove translations from this stack.undo_levelsdefines the maximum number of translations in the stack.
Logging¶
- log_file_name
The path to the stroke log file, either absolute or expressed relative to
CONFIG_DIR.strokes.logby default.This only sets the path for stroke logs; main Plover logs are always written to
plover.log.
- enable_stroke_logging
Whether to log strokes.
Falseby default.
- enable_translation_logging
Whether to log translations.
Falseby default.
Interface¶
- start_minimized
Whether to hide the main window when Plover starts up.
Falseby default.
- show_stroke_display
Whether to show the paper tape when Plover starts up.
Falseby default.
- show_suggestions_display
Whether to show the suggestions window when Plover starts up.
Falseby default.
- translation_frame_opacity
The opacity of the Add Translation tool, in percent. 100 by default.
- classic_dictionaries_display_order
The order the dictionaries are displayed in the main window.
Truedisplays the highest priority dictionary at the bottom;Falsedisplays it at the top.Falseby default.
Plugins¶
- enabled_extensions
The list of extensions that are enabled.
Machine¶
- auto_start
Whether to enable Plover output when it starts up.
Falseby default.
- machine_type
The name of the currently active machine.
Keyboardby default.
- machine_specific_options
A dictionary of configuration options specific to the current machine. Consult your machine plugin’s documentation to see the available properties. For the default machine plugins, the following options are available:
- arpeggiate
Whether to enable arpeggiate mode on the keyboard.
Falseby default.
- port
The serial port for serial connections. No default value.
The value will most likely be different between platforms; Windows uses COM ports, e.g.
COM3, whereas Unix-like platforms use device paths, e.g./dev/cu.usbmodem14403or/dev/ttyACM0.
- baudrate
The baud rate for serial connections. 9600 by default.
- bytesize
The number of bits in a byte for serial connections. 8 by default.
- parity
The parity bit mode for serial connections, one of
N(none),O(odd),E(even),M(mark) orS(space).Nby default.
- stopbits
The number of stop bits for serial connections. 1 by default.
- timeout
The read timeout for serial connections in seconds. 2.0 (2 seconds) by default.
- xonxoff
Whether to use XON/XOFF flow control for serial connections.
Falseby default.
- rtscts
Whether to use RTS/CTS flow control for serial connections.
Falseby default.
System¶
- system_name
The name of the current steno system. This is the same system that
plover.systemrefers to.English Stenotypeby default.
- system_keymap
A
Keymapmapping between machine keys and steno keys in the current steno system.If the system defines a keymap in
KEYMAPSfor the current machine type, that will be the default value; otherwise, the machine may define aKEYMAP_MACHINE_TYPEthat describes a similar machine to fall back on. If that is not available either, the default value is an empty keymap.
- dictionaries
A list of
DictionaryConfigrepresenting the list of dictionaries Plover uses to translate strokes for the current steno system. The dictionaries should be listed in order of decreasing priority.