getgauge/parser_parso.py
def refactor_step(self, old_text, new_text, move_param_from_idx):
        """
        Find the step with old_text and change it to new_text.The step function
        parameters are also changed according to move_param_from_idx.
        Each entry in this list should specify parameter position from old.
        """
        diffs = []
        step, func = self._find_step_node(old_text)
        if step is None:
            return diffs
        step_diff = self._refactor_step_text(step, old_text, new_text)
        diffs.append(step_diff)
        params_list_node = func.children[2]
        moved_params = self._move_param_nodes(
            params_list_node.children, move_param_from_idx)
        if params_list_node.children is not moved_params:
            # Record original parameter list span excluding braces
            params_span = self._span_from_pos(
                params_list_node.children[0].end_pos,
                params_list_node.children[-1].start_pos)
            params_list_node.children = moved_params
            # Get code for moved paramters excluding braces
            param_code = ''.join(p.get_code() for p in moved_params[1:-1])
            diffs.append((params_span, param_code))
        return diffs
def refactor_step(self, old_text, new_text, move_param_from_idx):
        diffs = []
        step, func = self._find_step_node(old_text)
        if step is None:
            return diffs
        step_diff = self._refactor_step_text(step, old_text, new_text)
        diffs.append(step_diff)
        params_list_node = func.children[2]
        moved_params = self._move_param_nodes(
            params_list_node.children, move_param_from_idx)
        if params_list_node.children is not moved_params:
            # Record original parameter list span excluding braces
            params_span = self._span_from_pos(
                params_list_node.children[0].end_pos,
                params_list_node.children[-1].start_pos)
            params_list_node.children = moved_params
            # Get code for moved paramters excluding braces
            param_code = ''.join(p.get_code() for p in moved_params[1:-1])
            diffs.append((params_span, param_code))
        return diffs
def refactor_step ( self , old_text , new_text , move_param_from_idx ) : diffs = [ ] step , func = self . _find_step_node ( old_text ) if step is None : return diffs step_diff = self . _refactor_step_text ( step , old_text , new_text ) diffs . append ( step_diff ) params_list_node = func . children [ 2 ] moved_params = self . _move_param_nodes ( params_list_node . children , move_param_from_idx ) if params_list_node . children is not moved_params : # Record original parameter list span excluding braces params_span = self . _span_from_pos ( params_list_node . children [ 0 ] . end_pos , params_list_node . children [ - 1 ] . start_pos ) params_list_node . children = moved_params # Get code for moved paramters excluding braces param_code = '' . join ( p . get_code ( ) for p in moved_params [ 1 : - 1 ] ) diffs . append ( ( params_span , param_code ) ) return diffs
Find the step with old_text and change it to new_text.The step function
        parameters are also changed according to move_param_from_idx.
        Each entry in this list should specify parameter position from old.
Find the step with old_text and change it to new_text . The step function parameters are also changed according to move_param_from_idx . Each entry in this list should specify parameter position from old .