puremvc.patterns.mediator package

Submodules

puremvc.patterns.mediator.Mediator module

class puremvc.patterns.mediator.Mediator.Mediator(mediator_name: Optional[str] = None, view_component: Optional[Any] = None)

Bases: Notifier, IMediator

A base IMediator implementation.

See Also

puremvc.core.View

NAME = 'Mediator'
handle_notification(notification: INotification)

Handle INotification.

Typically, this will be handled in an if/else statement, with one ‘comparison’ entry per INotification the Mediator is interested in.

Parameters:

notification (INotification) – The notification to be handled.

Returns:

None

list_notification_interests() [<class 'str'>]

List the INotification names this Mediator is interested in being notified of.

Returns:

List the list of INotification names

Return type:

List[str]

property mediator_name: str

Get the name of the Mediator.

Returns:

The name of the mediator.

Return type:

str

on_register()

Called by the View when the Mediator is registered

on_remove()

Called by the View when the Mediator is removed

property view_component: Any

Get the Mediator view component.

Returns:

The view component.

Return type:

Any

Module contents