RefactoringRope/RefactoringServer.py

branch
eric7
changeset 406
923d7f711cae
parent 396
933b8fcd854f
child 409
65153bf17e8d
--- a/RefactoringRope/RefactoringServer.py	Thu Nov 17 18:07:34 2022 +0100
+++ b/RefactoringRope/RefactoringServer.py	Tue Dec 20 14:18:42 2022 +0100
@@ -15,13 +15,28 @@
 from PyQt6.QtWidgets import QMenu, QApplication
 from PyQt6.Qsci import QsciScintilla
 
-from eric7 import Globals, Preferences, Utilities
+from eric7 import Preferences, Utilities
 from eric7.EricGui.EricAction import EricAction
 from eric7.EricNetwork.EricJsonServer import EricJsonServer
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.Preferences.Shortcuts import readShortcuts
 
+try:
+    from eric7.SystemUtilities.FileSystemUtilities import (
+        normcasepath
+    )
+except ImportError:
+    # imports for eric < 23.1
+    from eric7.Utilities import normcasepath
+try:
+    from eric7.SystemUtilities.PythonUtilities import (
+        getPythonExecutable, getPythonLibraryDirectory
+    )
+except ImportError:
+    # imports for eric < 23.1
+    from eric7.Globals import getPythonExecutable, getPythonLibraryDirectory
+
 
 from .RopeProgressDialog import RopeProgressDialog
 
@@ -2307,7 +2322,7 @@
             if venvName:
                 interpreter = venvManager.getVirtualenvInterpreter(venvName)
                 if not interpreter:
-                    interpreter = Globals.getPythonExecutable()
+                    interpreter = getPythonExecutable()
                 execPath = venvManager.getVirtualenvExecPath(venvName)
 
                 # build a suitable environment
@@ -2319,7 +2334,7 @@
                     else:
                         clientEnv["PATH"] = execPath
             else:
-                interpreter = Globals.getPythonExecutable()
+                interpreter = getPythonExecutable()
             if interpreter:
                 if isRemote:
                     self.__ui.appendToStderr(
@@ -2416,10 +2431,10 @@
         @param changedFiles list of changed files
         @type list of str
         """
-        openFiles = [Utilities.normcasepath(f) for f in self.__vm.getOpenFilenames()]
+        openFiles = [normcasepath(f) for f in self.__vm.getOpenFilenames()]
 
         for fileName in changedFiles:
-            normfile = Utilities.normcasepath(fileName)
+            normfile = normcasepath(fileName)
             if normfile in openFiles:
                 editor = self.__vm.getEditor(normfile)[1]
                 editor.refresh()
@@ -2532,7 +2547,7 @@
             ok, exitCode = self.startClient(
                 interpreter,
                 client,
-                [self.__projectpath, Globals.getPythonLibraryDirectory()],
+                [self.__projectpath, getPythonLibraryDirectory()],
                 environment=clientEnv,
             )
             if not ok and exitCode == 42:

eric ide

mercurial