webthing/thing.py
def perform_action(self, action_name, input_=None):
        """
        Perform an action on the thing.

        action_name -- name of the action
        input_ -- any action inputs

        Returns the action that was created.
        """
        if action_name not in self.available_actions:
            return None

        action_type = self.available_actions[action_name]

        if 'input' in action_type['metadata']:
            try:
                validate(input_, action_type['metadata']['input'])
            except ValidationError:
                return None

        action = action_type['class'](self, input_=input_)
        action.set_href_prefix(self.href_prefix)
        self.action_notify(action)
        self.actions[action_name].append(action)
        return action
def perform_action(self, action_name, input_=None):
        if action_name not in self.available_actions:
            return None

        action_type = self.available_actions[action_name]

        if 'input' in action_type['metadata']:
            try:
                validate(input_, action_type['metadata']['input'])
            except ValidationError:
                return None

        action = action_type['class'](self, input_=input_)
        action.set_href_prefix(self.href_prefix)
        self.action_notify(action)
        self.actions[action_name].append(action)
        return action
def perform_action ( self , action_name , input_ = None ) : if action_name not in self . available_actions : return None action_type = self . available_actions [ action_name ] if 'input' in action_type [ 'metadata' ] : try : validate ( input_ , action_type [ 'metadata' ] [ 'input' ] ) except ValidationError : return None action = action_type [ 'class' ] ( self , input_ = input_ ) action . set_href_prefix ( self . href_prefix ) self . action_notify ( action ) self . actions [ action_name ] . append ( action ) return action
Perform an action on the thing.

        action_name -- name of the action
        input_ -- any action inputs

        Returns the action that was created.
Perform an action on the thing .