Info¶
Plugin information and configuration
This module provides information about the plugin and its configuration.
The plugin configuration is loaded from the PLUGININFO file in the plugin
directory. The configuration file should look like this:
NAME="My Plugin"
DESCRIPTION="This is a plugin"
AUTHOR=["Author 1", "Author 2"]
VERSION="1.0.0"
PREFIX="m"
REPOSITORY="User/MyPlugin"
Note
The
PREFIXis optional and will be used as the command prefix for the plugin. Additionally if version contains dev the prefix will bed{PREFIX}to indicate that it is a development version and prevent conflicts with the stable version.The
REPOSITORYis optional and should be in the formatUser/Repositoryor a URL to the GitHub repository. This enables automated checks for updates.
- npc.CONFIG: npc.types.PluginConfig¶
Plugin information (not npc but the plugin using npc)
- npc.BASE_PATH: pathlib.Path¶
Base path of the plugin (not npc but the plugin using npc)
- npc.IS_DEV: str¶
Explicit flag to check if the plugin is in development mode (not npc but the plugin using npc)
- npc.info.find_file_in_parents(file, start)¶
Find a file in the parent directories of the given path
- Parameters:
start (
pathlib.Path) – Path to start the search from
- Returns:
Path to the file or None if not found
- Return type:
- npc.info.load_config(path)¶
Load the plugin configuration from the given file
Changed in version 0.5.0: Move to agnostic pyproject instead of poetry specific
Changed in version 0.4.0: Return whether the plugin is a development version
- Parameters:
path (
pathlib.Path) – Path to the configuration file- Returns:
Plugin configuration and whether it is a development version
- Return type: