Register an action to be showed in the actions list.

        .. note:: A action can't be registered two times. If it happens, then
        an assert exception will be raised.

        :param action: The action to be registered.

def register_action(self, action):
        """Register an action to be showed in the actions list.

        .. note:: A action can't be registered two times. If it happens, then
        an assert exception will be raised.

        :param action: The action to be registered.
        """
        assert action.value not in self.actions
        self.actions[action.value] = action