utils.config

class register_module:

This class is a decorator used for registering modules within the C2G system.

Methods

  • __init__(self, name): Initializes the module with a given name.
  • __call__(self, module): Registers the module with the provided name and updates the module list.

Examples

>>> @register_module('add')
    >>> def add(a, b):
    >>>     return a+b
    >>> add(-10, 12)
    2
    >>> cfg.display_available_modules()
    Available Modules:
    ADD