Peas.PluginInfo

Fields

None

Methods

class

error_quark ()

get_authors ()

get_copyright ()

get_data_dir ()

get_dependencies ()

get_description ()

get_external_data (key)

get_help_uri ()

get_icon_name ()

get_module_dir ()

get_module_name ()

get_name ()

get_settings (schema_id)

get_version ()

get_website ()

has_dependency (module_name)

is_available ()

is_builtin ()

is_hidden ()

is_loaded ()

Details

class Peas.PluginInfo

The Peas.PluginInfo structure contains only private data and should only be accessed using the provided API.

classmethod error_quark()
Return type:

int

get_authors()
Returns:

the plugin’s author list.

Return type:

[str]

Gets a None-terminated array of strings with the authors of the plugin.

The relevant key in the plugin info file is “Authors”.

Returns:

the plugin’s copyright information.

Return type:

str

Gets the copyright of the plugin.

The relevant key in the plugin info file is “Copyright”.

get_data_dir()
Returns:

the plugin’s data dir.

Return type:

str

Gets the data dir of the plugin.

The module data directory is the directory where a plugin should find its runtime data. This is not a value read from the [struct`GLib`.KeyFile], but rather a value provided by the [class`Engine`], depending on where the plugin file was found.

get_dependencies()
Returns:

the plugin’s dependencies.

Return type:

[str]

Gets the dependencies of the plugin.

The [class`Engine`] will always ensure that the dependencies of a plugin are loaded when the said plugin is loaded. It means that dependencies are loaded before the plugin, and unloaded after it. Circular dependencies of plugins lead to undefined loading order.

The relevant key in the plugin info file is “Depends”.

get_description()
Returns:

the plugin’s description.

Return type:

str

Gets the description of the plugin.

The description of the plugin should be a string presenting the purpose of the plugin. It will typically be presented in a plugin’s about box.

The relevant key in the plugin info file is “Description”.

get_external_data(key)
Parameters:

key (str) – The key to lookup.

Returns:

the external data, or None if the external data could not be found.

Return type:

str or None

Gets external data specified for the plugin.

External data is specified in the plugin info file prefixed with X-. For example, if a key/value pair X-Peas=1 is specified in the key file, you can use “Peas” for key to retrieve the value “1”.

Note: that you can omit the X- prefix when retrieving the value, but not when specifying the value in the file.

New in version 1.6.

get_help_uri()
Returns:

the plugin’s help URI.

Return type:

str

Gets the help URI of the plugin.

The Help URI of a plugin will typically be presented by the plugin manager as a “Help” button linking to the URI. It can either be a HTTP URL on some website or a ghelp: URI if a Gnome help page is available for the plugin.

The relevant key in the plugin info file is “Help”. Other platform-specific keys exist for platform-specific help files. Those are “Help-GNOME”, “Help-Windows” and “Help-MacOS-X”.

get_icon_name()
Returns:

the plugin’s icon name.

Return type:

str

Gets the icon name of the plugin.

The icon of the plugin will be presented in the plugin manager UI. If no icon is specified, the default green puzzle icon will be used.

The relevant key in the plugin info file is “Icon”.

get_module_dir()
Returns:

the module directory.

Return type:

str

Gets the module directory.

The module directory is the directory where the plugin file was found. This is not a value from the [struct`GLib`.KeyFile], but rather a value provided by the [class`Engine`].

get_module_name()
Returns:

the module name.

Return type:

str

Gets the module name.

The module name will be used to find the actual plugin. The way this value will be used depends on the loader (i.e. on the language) of the plugin. This value is also used to uniquely identify a particular plugin.

The relevant key in the plugin info file is “Module”.

get_name()
Returns:

the plugin’s name.

Return type:

str

Gets the name of the plugin.

The name of a plugin should be a nice short string to be presented in UIs.

The relevant key in the plugin info file is “Name”.

get_settings(schema_id)
Parameters:

schema_id (str or None) – The schema id.

Returns:

a new Gio.Settings.

Return type:

Gio.Settings or None

Creates a new [class`Gio`.Settings] for the given schema_id and if gschemas.compiled is not in the module directory an attempt will be made to create it.

New in version 1.4.

get_version()
Returns:

the plugin’s version.

Return type:

str

Gets the version of the plugin.

The relevant key in the plugin info file is “Version”.

get_website()
Returns:

the plugin’s associated website.

Return type:

str

Gets the website of the plugin.

The relevant key in the plugin info file is “Website”.

has_dependency(module_name)
Parameters:

module_name (str) – The name of the plugin to check.

Returns:

whether the plugin depends on the plugin module_name.

Return type:

bool

Check if the plugin depends on another plugin.

is_available()
Raises:

GLib.Error

Returns:

True if the plugin is available.

Return type:

bool

Check if the plugin is available.

A plugin is marked as not available when there is no loader available to load it, or when there has been an error when trying to load it previously. If not available then error will be set.

is_builtin()
Returns:

True if the plugin is a builtin plugin, False if not.

Return type:

bool

Check if the plugin is a builtin plugin.

A builtin plugin is a plugin which cannot be enabled or disabled by the user through a plugin manager (like PeasGtkPluginManager). Loading or unloading such plugins is the responsibility of the application alone. Most applications will usually load those plugins immediately after the initialization of the Peas.Engine.

The relevant key in the plugin info file is “Builtin”.

is_hidden()
Returns:

True if the plugin is a hidden plugin, False if not.

Return type:

bool

Check if the plugin is a hidden plugin.

A hidden plugin is a plugin which cannot be seen by a user through a plugin manager (like PeasGtkPluginManager). Loading and unloading such plugins is the responsibility of the application alone or through plugins that depend on them.

The relevant key in the plugin info file is “Hidden”.

is_loaded()
Returns:

True if the plugin is loaded.

Return type:

bool

Check if the plugin is loaded.