def __init__(
        self,
        parent,
        data,
        surface_map,
    ):
        """Store variables and perform setups.

        Parameters
        ==========

        parent (menu.submenu.main.Menu or
                menu.main.MenuManager instance)
            object regarded as parent of this Command
            instance.
        data (dict)
            command additional data.
        surface_map (dict)
            dict containing surfaces, nested or not.
        """
        ### store arguments

        self.parent = parent
        self.label_text = data["label"]

        ### perform extra setups depending on data received

        if set(data["label"]) == {"-"}:

            self.invoke = empty_function
            self.surface_map = surface_map

        elif "widget" in data:

            self.top_surface_map = surface_map

            if data["widget"] == "checkbutton":

                self.set_callable = data['set_callable']
                self.get_callable = data['get_callable']

                self.invoke = self.toggle_boolean

            elif data["widget"] == "radiobutton":

                self.value = data['value']

                self.set_callable = data['set_callable']
                self.get_callable = data['get_callable']

                self.invoke = self.set_value

            else:
                raise ValueError(
                    "if 'widget' key exists, it must"
                    " be either 'checkbutton' or"
                    " 'radiobutton'"
                )

            ##

            self.surface_map_updating_routine = self.update_surface_map

            self.surface_map_updating_routine()

        else:

            self.invoke = data["command"]
            self.surface_map = surface_map

        ### reference the normal surface as the 'image'
        ### attribute of this instance and also obtain
        ### a rect from it

        self.image = self.surface_map["normal"]
        self.rect = self.image.get_rect()
Store variables and perform setups.

        Parameters
        ==========

        parent (menu.submenu.main.Menu or
                menu.main.MenuManager instance)
            object regarded as parent of this Command
            instance.
        data (dict)
            command additional data.
        surface_map (dict)
            dict containing surfaces, nested or not.
        
nodezator/menu/command.py