Skip to content

Uefi helper plugin

uefi_helper_plugin

Plugin that supports adding Extension or helper methods to the build environment.

IUefiHelperPlugin

The class that should be subclassed when creating a UEFI Helper Plugin.

RegisterHelpers

RegisterHelpers(obj: HelperFunctions) -> None

Allows a plugin to register its functions.

Tip

obj.Register()

Args: obj (HelperFunctions): HelperFunctions object that allows functional registration

HelperFunctions

A class that contains all registed functions.

Attributes:

Name Type Description
RegisteredFunctions(dict)

registered functions

__init__

__init__() -> None

Initializes instance.

DebugLogRegisteredFunctions

DebugLogRegisteredFunctions() -> None

Logs all registered functions and their source path.

Uses logging.debug to write all registered functions and their source path.

Register

Register(
    name: str, function: Callable, filepath: str
) -> None

Registers a plugin.

Plugins that want to register a helper function should call this routine for each function

Parameters:

Name Type Description Default
name str

name of the function

required
function Callable

function being registered

required
filepath str

filepath to this file

required

Tip

os.path.abspath(__file__)

HasFunction

HasFunction(name: str) -> bool

Returns if a function exists.

Parameters:

Name Type Description Default
name str

name of the function

required

Returns:

Type Description
bool

if the function is registered or not.

LoadFromPluginManager

LoadFromPluginManager(pm: PluginManager) -> int

Load all IUefiHelperPlugins into the class.

Uses the PluginManager class to get all IUefiHelperPlugins in the environment, then stores them all in a dict.

Parameters:

Name Type Description Default
pm PluginManager

class holding all plugins

required

Returns:

Type Description
int

number of plugins that failed to be loaded.