(self, trigger, *args)
Set which functions to run for certain events.
        
        Currently supported:
            OnMenuOpen
            OnMenuClose
            OnWindowHide
            OnWindowRestore
Set which functions to run for certain events.
        
        Currently supported:
            OnMenuOpen
            OnMenuClose
            OnWindowHide
            OnWindowRestore
Set which functions to run for certain events . Currently supported : OnMenuOpen OnMenuClose OnWindowHide OnWindowRestore
def set_event(self, trigger, *args):
        """Set which functions to run for certain events.
        
        Currently supported:
            OnMenuOpen
            OnMenuClose
            OnWindowHide
            OnWindowRestore
        """
        if trigger not in self._commands:
            return
        valid_functions = []
        for func in args:
            if callable(func):
                valid_functions.append(func)
                self.logger.info('Registered "%s" for trigger "%s".', func.__name__, trigger)
            else:
                try:
                    self.logger.warning('Failed to register "%s" for trigger "%s".', func.__name__, trigger)
                except AttributeError:
                    self.logger.warning('Failed to register "%s" for trigger "%s".', str(func), trigger)
        self._commands[trigger] = valid_functions
def set_event ( self , trigger , * args ) : if trigger not in self . _commands : return valid_functions = [ ] for func in args : if callable ( func ) : valid_functions . append ( func ) self . logger . info ( 'Registered "%s" for trigger "%s".' , func . __name__ , trigger ) else : try : self . logger . warning ( 'Failed to register "%s" for trigger "%s".' , func . __name__ , trigger ) except AttributeError : self . logger . warning ( 'Failed to register "%s" for trigger "%s".' , str ( func ) , trigger ) self . _commands [ trigger ] = valid_functions