src/melody/search.py
def _recurse(self, inputs, output):
        '''internal recursion routine called by the run method that generates
        all input combinations'''
        if inputs:
            my_input = inputs[0]
            name = my_input.name
            if my_input.state:
                my_options = my_input.options(self.state)
            else:
                my_options = my_input.options
            for option in my_options:
                my_output = list(output)
                my_output.append({name: option})
                self._recurse(inputs[1:], my_output)
        else:
            try:
                valid, result = self._function(output)
            except ValueError:
                raise RuntimeError("function must return 2 values")
            print output, valid, result
def _recurse(self, inputs, output):
        '''internal recursion routine called by the run method that generates
        all input combinations'''
        if inputs:
            my_input = inputs[0]
            name = my_input.name
            if my_input.state:
                my_options = my_input.options(self.state)
            else:
                my_options = my_input.options
            for option in my_options:
                my_output = list(output)
                my_output.append({name: option})
                self._recurse(inputs[1:], my_output)
        else:
            try:
                valid, result = self._function(output)
            except ValueError:
                raise RuntimeError("function must return 2 values")
            print output, valid, result
def _recurse ( self , inputs , output ) : if inputs : my_input = inputs [ 0 ] name = my_input . name if my_input . state : my_options = my_input . options ( self . state ) else : my_options = my_input . options for option in my_options : my_output = list ( output ) my_output . append ( { name : option } ) self . _recurse ( inputs [ 1 : ] , my_output ) else : try : valid , result = self . _function ( output ) except ValueError : raise RuntimeError ( "function must return 2 values" ) print output , valid , result
internal recursion routine called by the run method that generates
        all input combinations
internal recursion routine called by the run method that generates all input combinations