RefactoringRope/CodeAssistServer.py

branch
eric7
changeset 420
fa31c3a0df1d
parent 414
af1d72eccf91
child 422
f98253eed7f0
equal deleted inserted replaced
419:78a87fd0c83e 420:fa31c3a0df1d
13 import sys 13 import sys
14 import uuid 14 import uuid
15 15
16 from PyQt6.QtCore import QCoreApplication, QTimer, pyqtSlot 16 from PyQt6.QtCore import QCoreApplication, QTimer, pyqtSlot
17 17
18 from eric7 import Globals, Preferences 18 from eric7 import Preferences
19 from eric7.EricNetwork.EricJsonServer import EricJsonServer 19 from eric7.EricNetwork.EricJsonServer import EricJsonServer
20 from eric7.EricWidgets import EricMessageBox 20 from eric7.EricWidgets import EricMessageBox
21 from eric7.EricWidgets.EricApplication import ericApp 21 from eric7.EricWidgets.EricApplication import ericApp
22
23 try:
24 from eric7.EricUtilities import getConfigDir
25 except ImportError:
26 # backward compatibility for eric < 24.10
27 from Globals import getConfigDir
22 28
23 try: 29 try:
24 from eric7.SystemUtilities.PythonUtilities import ( 30 from eric7.SystemUtilities.PythonUtilities import (
25 getPythonExecutable, 31 getPythonExecutable,
26 getPythonLibraryDirectory, 32 getPythonLibraryDirectory,
27 ) 33 )
28 except ImportError: 34 except ImportError:
29 # imports for eric < 23.1 35 # backward compatibility for eric < 23.1
30 from eric7.Globals import getPythonExecutable, getPythonLibraryDirectory 36 from eric7.Globals import getPythonExecutable, getPythonLibraryDirectory
31 37
32 try: 38 try:
33 from eric7.QScintilla.Editor import EditorIconId 39 from eric7.QScintilla.Editor import EditorIconId
34 40
82 @param plugin reference to the plugin object 88 @param plugin reference to the plugin object
83 @type RefactoringRopePlugin 89 @type RefactoringRopePlugin
84 @param parent parent 90 @param parent parent
85 @type QObject 91 @type QObject
86 """ 92 """
87 super().__init__("CodeAssistServer", multiplex=True, parent=parent) 93 try:
94 super().__init__(
95 name="CodeAssistServer",
96 interface=Preferences.getDebugger("NetworkInterface"),
97 multiplex=True,
98 parent=parent,
99 )
100 except TypeError:
101 # backward compatibility for eric < 24.10
102 super().__init__(
103 name="CodeAssistServer",
104 multiplex=True,
105 parent=parent
106 )
88 107
89 self.__plugin = plugin 108 self.__plugin = plugin
90 self.__ui = parent 109 self.__ui = parent
91 self.__vm = ericApp().getObject("ViewManager") 110 self.__vm = ericApp().getObject("ViewManager")
92 self.__e5project = ericApp().getObject("Project") 111 self.__e5project = ericApp().getObject("Project")
721 740
722 if interpreter: 741 if interpreter:
723 if idString == CodeAssistServer.IdProject: 742 if idString == CodeAssistServer.IdProject:
724 configDir = self.__e5project.getProjectPath() 743 configDir = self.__e5project.getProjectPath()
725 else: 744 else:
726 configDir = os.path.join(Globals.getConfigDir(), "rope", idString) 745 configDir = os.path.join(getConfigDir(), "rope", idString)
727 if not os.path.exists(configDir): 746 if not os.path.exists(configDir):
728 os.makedirs(configDir) 747 os.makedirs(configDir)
729 748
730 client = os.path.join(os.path.dirname(__file__), "CodeAssistClient.py") 749 client = os.path.join(os.path.dirname(__file__), "CodeAssistClient.py")
731 ok, exitCode = self.startClient( 750 ok, exitCode = self.startClient(

eric ide

mercurial