Skip to content

plpipes.action.registry#

register_class(action_type, action_class, *suffixes) #

Register a new action class with its associated action type and suffixes.

Parameters: action_type (str): The type of action being registered. action_class (type): The class that implements the action. suffixes (str): One or more file suffixes associated with the action type.

Source code in src\plpipes\action\registry.py
def register_class(action_type, action_class, *suffixes):
    """
    Register a new action class with its associated action type and suffixes.

    Parameters:
    action_type (str): The type of action being registered.
    action_class (type): The class that implements the action.
    suffixes (str): One or more file suffixes associated with the action type.
    """
    _class_registry[action_type] = action_class

    for suffix in suffixes:
        _suffix_registry.append((suffix, action_type))

    _suffix_registry.sort(key=lambda x: len(x[0]), reverse=True)