modern_urwid.resource.registry

Handles storing Python modules

Classes

ModuleRegistry()

Simple registry for Python modules

class modern_urwid.resource.registry.ModuleRegistry

Bases: object

Simple registry for Python modules

get(name: str) ModuleType

Get a registered module

Parameters:

name (str) – The name of the module

Raises:

UnknownModule – Raises if a module is not found with the given name

Returns:

The Python module, if registered

Return type:

types.ModuleType

is_registered(name: str)
register(name: str, module: ModuleType)

Store the given module in the registry

Parameters:
  • name (str) – The name of the module

  • module (types.ModuleType) – The Python module to register