def METHOD_NAME(self, name, items_generator):
    """Registers a new menu items generator.
    :param name: a short identifier
    :param items_generator: generates list of menu items
    :type items_generator: fun: request → [MenuItem]
    """
    assert name not in self._generators
    self._generators[name] = items_generator