:right-sidebar: True Module =================================================================== .. currentmodule:: gi.repository.GModule .. class:: Module(*args, **kwargs) :no-contents-entry: The :obj:`~gi.repository.GModule.Module` struct is an opaque data structure to represent a [dynamically-loaded module][glib-Dynamic-Loading-of-Modules]. It should only be accessed via the following functions. Methods ------- .. rst-class:: interim-class .. class:: Module :no-index: .. classmethod:: build_path(module_name: str) -> str A portable way to build the filename of a module. The platform-specific prefix and suffix are added to the filename, if needed, and the result is added to the directory, using the correct separator character. The directory should specify the directory where the module can be found. It can be :const:`None` or an empty string to indicate that the module is in a standard platform-specific directory, though this is not recommended since the wrong module may be found. For example, calling :func:`~gi.repository.GModule.Module.build_path` on a Linux system with a ``directory`` of ``/lib`` and a ``module_name`` of "mylibrary" will return ``/lib/libmylibrary.so``\. On a Windows system, using ``\Windows`` as the directory it will return ``\Windows\mylibrary.dll``\. .. deprecated:: 2.76 Use :func:`~gi.repository.GModule.Module.open` instead with ``module_name`` as the basename of the file_name argument. See %G_MODULE_SUFFIX for why. :param module_name: the name of the module .. method:: close() -> bool Closes a module. .. classmethod:: error() -> str Gets a string describing the last module error. .. classmethod:: error_quark() -> int .. method:: make_resident() -> None Ensures that a module will never be unloaded. Any future :func:`~gi.repository.GModule.Module.close` calls on the module will be ignored. .. method:: name() -> str Returns the filename that the module was opened with. If ``module`` refers to the application itself, "main" is returned. .. classmethod:: supported() -> bool Checks if modules are supported on the current platform. .. method:: symbol(symbol_name: str) -> ~typing.Tuple[bool, ~typing.Any | None] Gets a symbol pointer from a module, such as one exported by %G_MODULE_EXPORT. Note that a valid symbol can be :const:`None`. :param symbol_name: the name of the symbol to find