(self, filePath, start, end, newName, indent_size)
return valueToReturn
Extracts a method
Extracts a method
Extracts a method
def _extractMethod(self, filePath, start, end, newName, indent_size):
        """
        Extracts a method
        """
        project = rope.base.project.Project(
            WORKSPACE_ROOT, ropefolder=ROPE_PROJECT_FOLDER, save_history=False, indent_size=indent_size)
        resourceToRefactor = libutils.path_to_resource(project, filePath)
        refactor = ExtractMethodRefactor(
            project, resourceToRefactor, startOffset=start, endOffset=end, newName=newName, similar=True)
        refactor.refactor()
        changes = refactor.changes
        project.close()
        valueToReturn = []
        for change in changes:
            valueToReturn.append({'diff': change.diff})
        return valueToReturn
def _extractMethod ( self , filePath , start , end , newName , indent_size ) : project = rope . base . project . Project ( WORKSPACE_ROOT , ropefolder = ROPE_PROJECT_FOLDER , save_history = False , indent_size = indent_size ) resourceToRefactor = libutils . path_to_resource ( project , filePath ) refactor = ExtractMethodRefactor ( project , resourceToRefactor , startOffset = start , endOffset = end , newName = newName , similar = True ) refactor . refactor ( ) changes = refactor . changes project . close ( ) valueToReturn = [ ] for change in changes : valueToReturn . append ( { 'diff' : change . diff } ) return valueToReturn