Wed, 23 Oct 2024 17:45:37 +0200
Adjusted code for eric7 24.10 and newer.
--- a/ChangeLog Wed Oct 23 17:44:39 2024 +0200 +++ b/ChangeLog Wed Oct 23 17:45:37 2024 +0200 @@ -1,5 +1,8 @@ ChangeLog --------- +Version 10.7.3 +- adjusted code for eric7 24.10 and newer + Version 10.7.2 - adjusted code for eric7 24.11 and newer
--- a/PluginRefactoringRope.py Wed Oct 23 17:44:39 2024 +0200 +++ b/PluginRefactoringRope.py Wed Oct 23 17:45:37 2024 +0200 @@ -26,7 +26,7 @@ author = "Detlev Offenbach <detlev@die-offenbachs.de>" autoactivate = True deactivateable = True -version = "10.7.2" +version = "10.7.3" className = "RefactoringRopePlugin" packageName = "RefactoringRope" shortDescription = "Refactoring and Code Assist using the Rope library." @@ -222,10 +222,10 @@ ericApp().getObject("PluginManager").shutdown.connect(self.__shutdown) - self.__codeAssistServer = CodeAssistServer(self, self.__ui) + self.__codeAssistServer = CodeAssistServer(self, parent=self.__ui) self.__codeAssistServer.activate() - self.__refactoringServer = RefactoringServer(self, self.__ui) + self.__refactoringServer = RefactoringServer(self, parent=self.__ui) self.__refactoringServer.activate() ericApp().getObject("PluginManager").shutdown.connect(self.__shutdown)
--- a/RefactoringRope/CodeAssistServer.py Wed Oct 23 17:44:39 2024 +0200 +++ b/RefactoringRope/CodeAssistServer.py Wed Oct 23 17:45:37 2024 +0200 @@ -15,18 +15,24 @@ from PyQt6.QtCore import QCoreApplication, QTimer, pyqtSlot -from eric7 import Globals, Preferences +from eric7 import Preferences from eric7.EricNetwork.EricJsonServer import EricJsonServer from eric7.EricWidgets import EricMessageBox from eric7.EricWidgets.EricApplication import ericApp try: + from eric7.EricUtilities import getConfigDir +except ImportError: + # backward compatibility for eric < 24.10 + from Globals import getConfigDir + +try: from eric7.SystemUtilities.PythonUtilities import ( getPythonExecutable, getPythonLibraryDirectory, ) except ImportError: - # imports for eric < 23.1 + # backward compatibility for eric < 23.1 from eric7.Globals import getPythonExecutable, getPythonLibraryDirectory try: @@ -84,7 +90,20 @@ @param parent parent @type QObject """ - super().__init__("CodeAssistServer", multiplex=True, parent=parent) + try: + super().__init__( + name="CodeAssistServer", + interface=Preferences.getDebugger("NetworkInterface"), + multiplex=True, + parent=parent, + ) + except TypeError: + # backward compatibility for eric < 24.10 + super().__init__( + name="CodeAssistServer", + multiplex=True, + parent=parent + ) self.__plugin = plugin self.__ui = parent @@ -723,7 +742,7 @@ if idString == CodeAssistServer.IdProject: configDir = self.__e5project.getProjectPath() else: - configDir = os.path.join(Globals.getConfigDir(), "rope", idString) + configDir = os.path.join(getConfigDir(), "rope", idString) if not os.path.exists(configDir): os.makedirs(configDir)
--- a/RefactoringRope/HelpDialog.py Wed Oct 23 17:44:39 2024 +0200 +++ b/RefactoringRope/HelpDialog.py Wed Oct 23 17:45:37 2024 +0200 @@ -15,7 +15,7 @@ try: from eric7.SystemUtilities.OSUtilities import isWindowsPlatform except ImportError: - # imports for eric < 23.1 + # backward compatibility for eric < 23.1 from eric7.Globals import isWindowsPlatform
--- a/RefactoringRope/HistoryDialog.py Wed Oct 23 17:44:39 2024 +0200 +++ b/RefactoringRope/HistoryDialog.py Wed Oct 23 17:45:37 2024 +0200 @@ -18,7 +18,7 @@ try: from eric7.SystemUtilities.OSUtilities import isWindowsPlatform except ImportError: - # imports for eric < 23.1 + # backward compatibility for eric < 23.1 from eric7.Globals import isWindowsPlatform from .Ui_HistoryDialog import Ui_HistoryDialog
--- a/RefactoringRope/MoveDialog.py Wed Oct 23 17:44:39 2024 +0200 +++ b/RefactoringRope/MoveDialog.py Wed Oct 23 17:45:37 2024 +0200 @@ -19,7 +19,7 @@ try: from eric7.SystemUtilities.FileSystemUtilities import toNativeSeparators except ImportError: - # imports for eric < 23.1 + # backward compatibility for eric < 23.1 from eric7.Utilities import toNativeSeparators from .RefactoringDialogBase import RefactoringDialogBase
--- a/RefactoringRope/PreviewDialogBase.py Wed Oct 23 17:44:39 2024 +0200 +++ b/RefactoringRope/PreviewDialogBase.py Wed Oct 23 17:45:37 2024 +0200 @@ -16,7 +16,7 @@ try: from eric7.SystemUtilities.OSUtilities import isWindowsPlatform except ImportError: - # imports for eric < 23.1 + # backward compatibility for eric < 23.1 from eric7.Globals import isWindowsPlatform from .Ui_PreviewDialog import Ui_PreviewDialog
--- a/RefactoringRope/RefactoringServer.py Wed Oct 23 17:44:39 2024 +0200 +++ b/RefactoringRope/RefactoringServer.py Wed Oct 23 17:45:37 2024 +0200 @@ -25,7 +25,7 @@ try: from eric7.SystemUtilities.FileSystemUtilities import normcasepath except ImportError: - # imports for eric < 23.1 + # backward compatibility for eric < 23.1 from eric7.Utilities import normcasepath try: from eric7.SystemUtilities.PythonUtilities import ( @@ -33,12 +33,12 @@ getPythonLibraryDirectory, ) except ImportError: - # imports for eric < 23.1 + # backward compatibility for eric < 23.1 from eric7.Globals import getPythonExecutable, getPythonLibraryDirectory try: from eric7.SystemUtilities.FileSystemUtilities import isRemoteFileName except ImportError: - # imports for eric < 24.1 + # backward compatibility for eric < 24.1 from .RefactoringRope.RopeUtilities import isRemoteFileName from .RopeProgressDialog import RopeProgressDialog @@ -60,7 +60,18 @@ """ from .FileSystemCommands import EricFileSystemCommands - super().__init__("RefactoringServer", parent=parent) + try: + super().__init__( + name="RefactoringServer", + interface=Preferences.getDebugger("NetworkInterface"), + parent=parent, + ) + except TypeError: + # backward compatibility for eric < 24.10 + super().__init__( + name="RefactoringServer", + parent=parent, + ) self.__plugin = plugin self.__ui = parent