def highlight_widget_and_parents(self, widget):
        """Highlight widget and its parents recursively.

        widget (either a menu.main.MenuManager or
                menu.submenu.main.Menu or
                menu.Command instance)
        """
        ### highlight the widget
        widget.highlight()

        ### try highlighting its parent
        try:
            self.highlight_widget_and_parents(widget.parent)

        ### this will catch the attribute error when trying
        ### to execute MenuManager.highlight, since the
        ### MenuManager instance is always at the top of the
        ### hierarchy of widgets and it doesn't have a
        ### highlight method
        except AttributeError:
            pass
Highlight widget and its parents recursively.

        widget (either a menu.main.MenuManager or
                menu.submenu.main.Menu or
                menu.Command instance)
        
nodezator/menu/behaviour.py