Apply some addons to a widget.

    :param widget: The widget to apply addons to.
    :param addon_types: A list of addon types, which will be instantiated
                         and applied to the widget with the default name of
                         the addon.
    :param named_addon_types: A named list of addons, the keywords will be
                               the name of the addon when loaded and will
                               override the default addon name. This can
                               allow loading the same addon multpily for the
                               same widget under different names.

    Plugins should conform to the GObjectPlugin interface or be a subclass of
    it. Once loaded, addons will be available as widget.addons.<addon_name>
    withe standard attribute access.

def apply_addons(widget, *addon_types, **named_addon_types):
    """Apply some addons to a widget.

    :param widget: The widget to apply addons to.
    :param addon_types: A list of addon types, which will be instantiated
                         and applied to the widget with the default name of
                         the addon.
    :param named_addon_types: A named list of addons, the keywords will be
                               the name of the addon when loaded and will
                               override the default addon name. This can
                               allow loading the same addon multpily for the
                               same widget under different names.

    Plugins should conform to the GObjectPlugin interface or be a subclass of
    it. Once loaded, addons will be available as widget.addons.<addon_name>
    withe standard attribute access.
    """
    for addon_type in addon_types:
        addon_type(widget)

    for name, addon_type in named_addon_types.items():
        addon_type(widget, addon_name=name)