def on_mouse_action(self, method_name, event):
        """Act according to method name and mouse event."""
        ### retrieve the mouse position from the event
        mouse_pos = event.pos

        ### if the event, regardless of type, occurred
        ### outside the splash screen boundaries, raise
        ### a SwitchLoopException without arguments,
        ### which causes the window manager to obtain
        ### control of the screen, that is, the splash
        ### screen looses focus and disappears
        if not self.rect.collidepoint(mouse_pos):
            raise SwitchLoopException

        ### otherwise, iterate over the buttons, checking
        ### whether any of them collides with the mouse
        ### and has a method with the same name as the one
        ### received, in which case it is executed;
        ###
        ### regardless of whether the colliding button has
        ### the mentioned method or not, we then break out
        ### of the "for loop"

        else:

            ## iterate over buttons

            for button in self.buttons:

                ## if a button collides check existence of
                ## method with given name and execute it
                ## if it is the case, then break out of
                ## the "for loop" after such check,
                ## regardless of what happened

                if button.rect.collidepoint(mouse_pos):

                    try:
                        method = getattr(button, method_name)
                    except AttributeError:
                        pass
                    else:
                        method(event)

                    break
Act according to method name and mouse event.
nodezator/splashscreen/op.py