libdnf5.plugin

class libdnf5.plugin.IPlugin(data)

A base class for implementing LIBDNF5 plugins that introduce additional logic into the library using hooks.

finish()

Finish the plugin and release all resources obtained by the init method and in hooks.

get_api_version()

Returns the version of the API supported by the plugin. It can be called at any time.

get_attribute(name)

Gets the value of the attribute from the plugin. Returns nullptr if the attribute does not exist. It can be called at any time.

get_attributes()
Return type:

string

Returns:

A nullptr terminated array of attributes supported by the plugin.

get_base()
get_name()

Returns the name of the plugin. It can be called at any time.

get_version()

Gets the plugin version. It can be called at any time.

init()

Plugin initialization. Called before hooks.

load_plugins()

The plugin can load additional plugins. E.g. C++ plugin for loading Python plugins. Called before init.

post_add_cmdline_packages()

The post_add_cmdline_packages hook. It is called at the end of the RepoSack::add_cmdline_packages method.

post_base_setup()

The post_base_setup hook. It is called at the end of the Base::setup method.

post_transaction(transaction)

The post_transaction hook. It is called after transactions. :type transaction: libdnf5::base::Transaction :param transaction: Contains the completed transaction.

pre_add_cmdline_packages(paths)

The pre_add_cmdline_packages hook. It is called at the beginning of the RepoSack::add_cmdline_packages method. :type paths: std::vector< std::string,std::allocator< std::string > > :param paths: Vector of paths (local files or URLs) to package files to be inserted into cmdline repo.

pre_base_setup()

The pre_base_setup hook. It is called at the beginning of the Base::setup method (after the init hook).

pre_transaction(transaction)

The pre_transaction hook. It is called just before the actual transaction starts. :type transaction: libdnf5::base::Transaction :param transaction: Contains the transaction that will be started.

repos_configured()

The repos_configured hook. It is called in Base::notify_repos_configured method.

repos_loaded()

The repos_loaded hook. It is called at the end of the RepoSack::load_repos method (in Impl).

thisown
class libdnf5.plugin.IPlugin2_1(*args, **kwargs)

Extended plugin interface with additional hooks introduced in version 2.1 of the plugin API.

goal_resolved(transaction)

The goal resolved hook. It is called right after the goal is resolved. :type transaction: libdnf5::base::Transaction :param transaction: Contains the transaction that was resolved.

thisown
class libdnf5.plugin.PluginInfo(*args)
get_api_version()
Return type:

PluginAPIVersion

Returns:

the version of the API supported by the plugin, or zeros if the plugin is not loaded

get_attribute(name)

Gets the value of the attribute from the plugin. Returns nullptr if the attribute does not exist or plugin is not loaded. :rtype: string :return: the value of the name attribute or nullptr

get_attributes()
Return type:

string

Returns:

a nullptr terminated array of attributes supported by the plugin or nullptr if the plugin is not loaded

get_name()
Return type:

string

Returns:

the real name of the plugin or derived from the configuration file if the plugin is not loaded

get_real_name()
Return type:

string

Returns:

the real plugin name (returned from plugin) or nullptr if the plugin is not loaded

get_version()
Return type:

Version

Returns:

the version of the plugin, or zeros if the plugin is not loaded

is_loaded()
Return type:

boolean

Returns:

true if the plugin is loaded

thisown
class libdnf5.plugin.Version(major, minor, micro)

Plugin version

major
micro
minor
thisown