RefactoringRope/Refactoring.py

branch
server_client_variant
changeset 176
117d86025a5c
parent 175
72a1d9030d67
child 178
70b4fb448811
equal deleted inserted replaced
175:72a1d9030d67 176:117d86025a5c
1048 1048
1049 ##################################################### 1049 #####################################################
1050 ## Inline refactorings 1050 ## Inline refactorings
1051 ##################################################### 1051 #####################################################
1052 1052
1053 # TODO: continue from here
1054 def __inline(self): 1053 def __inline(self):
1055 """ 1054 """
1056 Private slot to handle the Inline Local Variable action. 1055 Private slot to handle the Inline Local Variable action.
1057 """ 1056 """
1058 aw = e5App().getObject("ViewManager").activeWindow() 1057 aw = e5App().getObject("ViewManager").activeWindow()
1074 1073
1075 filename = aw.getFileName() 1074 filename = aw.getFileName()
1076 line, index, line1, index1 = aw.getSelection() 1075 line, index, line1, index1 = aw.getSelection()
1077 offset = self.__getOffset(aw, line, index) 1076 offset = self.__getOffset(aw, line, index)
1078 1077
1079 import rope.refactor.inline
1080 resource = rope.base.libutils.path_to_resource(
1081 self.__project, filename)
1082 try:
1083 inliner = rope.refactor.inline.create_inline(
1084 self.__project, resource, offset)
1085 except Exception as err:
1086 self.handleRopeError(err, title)
1087 return
1088
1089 from InlineDialog import InlineDialog 1078 from InlineDialog import InlineDialog
1090 self.dlg = InlineDialog(self, title, inliner, parent=self.__ui) 1079 dlg = InlineDialog(self, title, filename, offset, parent=self.__ui)
1091 self.dlg.show() 1080 changeGroup = dlg.getChangeGroupName()
1081 self.__refactoringDialogs[changeGroup] = dlg
1082 dlg.finished.connect(
1083 lambda: self.__refactoringDialogClosed(changeGroup))
1084 dlg.show()
1092 1085
1093 ##################################################### 1086 #####################################################
1094 ## Move refactorings 1087 ## Move refactorings
1095 ##################################################### 1088 #####################################################
1096 1089
1090 # TODO: continue from here
1097 def __moveMethod(self): 1091 def __moveMethod(self):
1098 """ 1092 """
1099 Private slot to handle the Move Method action. 1093 Private slot to handle the Move Method action.
1100 """ 1094 """
1101 aw = e5App().getObject("ViewManager").activeWindow() 1095 aw = e5App().getObject("ViewManager").activeWindow()

eric ide

mercurial