PluginRefactoringRope.py

changeset 151
5260100b6700
parent 148
5cfe8e02a9c4
child 153
9557ef516806
equal deleted inserted replaced
150:81aa22f5d2e6 151:5260100b6700
24 # Start-Of-Header 24 # Start-Of-Header
25 name = "Refactoring Rope Plugin" 25 name = "Refactoring Rope Plugin"
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 26 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
27 autoactivate = True 27 autoactivate = True
28 deactivateable = True 28 deactivateable = True
29 version = "4.2.6" 29 version = "4.2.7"
30 className = "RefactoringRopePlugin" 30 className = "RefactoringRopePlugin"
31 packageName = "RefactoringRope" 31 packageName = "RefactoringRope"
32 internalPackages = "rope" 32 internalPackages = "rope"
33 shortDescription = "Refactoring using the Rope library." 33 shortDescription = "Refactoring using the Rope library."
34 longDescription = """This plug-in implements refactoring functionality""" \ 34 longDescription = """This plug-in implements refactoring functionality""" \
305 loc = self.__ui.getLocale() 305 loc = self.__ui.getLocale()
306 if loc and loc != "C": 306 if loc and loc != "C":
307 locale_dir = \ 307 locale_dir = \
308 os.path.join(os.path.dirname(__file__), 308 os.path.join(os.path.dirname(__file__),
309 "RefactoringRope", "i18n") 309 "RefactoringRope", "i18n")
310 translation = "rope_%s" % loc 310 translation = "rope_{0}".format(loc)
311 translator = QTranslator(None) 311 translator = QTranslator(None)
312 loaded = translator.load(translation, locale_dir) 312 loaded = translator.load(translation, locale_dir)
313 if loaded: 313 if loaded:
314 self.__translator = translator 314 self.__translator = translator
315 e5App().installTranslator(self.__translator) 315 e5App().installTranslator(self.__translator)
516 editor.removeMouseClickHandlers("rope") 516 editor.removeMouseClickHandlers("rope")
517 except AttributeError: 517 except AttributeError:
518 # eric versions before 6.1.0 don't support this 518 # eric versions before 6.1.0 don't support this
519 pass 519 pass
520 520
521 def __completionListSelected(self, id, txt): 521 def __completionListSelected(self, userListId, txt):
522 """ 522 """
523 Private slot to handle the selection from the completion list. 523 Private slot to handle the selection from the completion list.
524 524
525 @param id the ID of the user list (should be 1) (integer) 525 @param userListId the ID of the user list (should be 1) (integer)
526 @param txt the selected text (QString) 526 @param txt the selected text (QString)
527 """ 527 """
528 from QScintilla.Editor import EditorAutoCompletionListID 528 from QScintilla.Editor import EditorAutoCompletionListID
529 529
530 editor = self.sender() 530 editor = self.sender()
531 if id == EditorAutoCompletionListID: 531 if userListId == EditorAutoCompletionListID:
532 lst = txt.split() 532 lst = txt.split()
533 if len(lst) > 1: 533 if len(lst) > 1:
534 txt = lst[0] 534 txt = lst[0]
535 535
536 if Preferences.getEditor("AutoCompletionReplaceWord"): 536 if Preferences.getEditor("AutoCompletionReplaceWord"):
686 (integer) 686 (integer)
687 @return list of possible calltips (list of strings) 687 @return list of possible calltips (list of strings)
688 """ 688 """
689 cts = self.__caObject.getCallTips(pos, editor) 689 cts = self.__caObject.getCallTips(pos, editor)
690 return cts 690 return cts
691
692 #
693 # eflag: noqa = M801

eric ide

mercurial