--- a/PluginRefactoringRope.py Sat Dec 23 15:48:55 2023 +0100 +++ b/PluginRefactoringRope.py Sat Dec 23 17:58:35 2023 +0100 @@ -11,6 +11,7 @@ import os from PyQt6.QtCore import QCoreApplication, QObject, Qt, QTranslator +from PyQt6.QtGui import QPalette from eric7 import Preferences, Utilities from eric7.EricWidgets.EricApplication import ericApp @@ -39,7 +40,7 @@ refactoringRopePluginObject = None -def createAutoCompletionPage(configDlg): +def createAutoCompletionPage(configDlg): # noqa: U100 """ Module function to create the autocompletion configuration page. @@ -48,16 +49,17 @@ @return reference to the configuration page @rtype AutoCompletionRopePage """ - global refactoringRopePluginObject from RefactoringRope.ConfigurationPage.AutoCompletionRopePage import ( AutoCompletionRopePage, ) + global refactoringRopePluginObject + page = AutoCompletionRopePage(refactoringRopePluginObject) return page -def createCallTipsPage(configDlg): +def createCallTipsPage(configDlg): # noqa: U100 """ Module function to create the calltips configuration page. @@ -66,14 +68,15 @@ @return reference to the configuration page @rtype CallTipsRopePage """ + from RefactoringRope.ConfigurationPage.CallTipsRopePage import CallTipsRopePage + global refactoringRopePluginObject - from RefactoringRope.ConfigurationPage.CallTipsRopePage import CallTipsRopePage page = CallTipsRopePage(refactoringRopePluginObject) return page -def createMouseClickHandlerPage(configDlg): +def createMouseClickHandlerPage(configDlg): # noqa: U100 """ Module function to create the mouse click handler configuration page. @@ -82,11 +85,12 @@ @return reference to the configuration page @rtype MouseClickHandlerRopePage """ - global refactoringRopePluginObject from RefactoringRope.ConfigurationPage.MouseClickHandlerRopePage import ( MouseClickHandlerRopePage, ) + global refactoringRopePluginObject + page = MouseClickHandlerRopePage(refactoringRopePluginObject) return page @@ -101,8 +105,6 @@ try: usesDarkPalette = ericApp().usesDarkPalette() except AttributeError: - from PyQt6.QtGui import QPalette - palette = ericApp().palette() lightness = palette.color(QPalette.Window).lightness() usesDarkPalette = lightness <= 128 @@ -207,18 +209,17 @@ @return tuple of None and activation status @rtype tuple of (None, bool) """ + from RefactoringRope.CodeAssistServer import CodeAssistServer + from RefactoringRope.RefactoringServer import RefactoringServer + global refactoringRopePluginObject refactoringRopePluginObject = self ericApp().getObject("PluginManager").shutdown.connect(self.__shutdown) - from RefactoringRope.CodeAssistServer import CodeAssistServer - self.__codeAssistServer = CodeAssistServer(self, self.__ui) self.__codeAssistServer.activate() - from RefactoringRope.RefactoringServer import RefactoringServer - self.__refactoringServer = RefactoringServer(self, self.__ui) self.__refactoringServer.activate() @@ -538,4 +539,4 @@ # -# eflag: noqa = M801 +# eflag: noqa = M801, U200