Config¶
- class npc.BaseConfig(plugin)¶
Base class for plugin configuration
This class is used to define the configuration of a plugin. It automatically generates the settings and metasettings for the plugin given the fields defined as class attributes.
- Parameters:
plugin (
npc.BasePlugin) – The plugin instance that the configuration is attached to.
- model_plugin¶
The plugin instance that the configuration is attached to.
- Type:
- __getattribute__(name)¶
Get the value of a setting or the attribute
- __setattr__(name, value)¶
Set the value of a setting or the attribute
This will automatically persist the changes to the Nicotine+ global configuration.
- model_settings()¶
Convert the model to settings
- Returns:
The settings dict generated from the model.
- Return type:
- model_metasettings()¶
Convert the model to metasettings
- Returns:
The metasettings dict generated from the model.
- Return type: