src/eric7/JediInterface/JediServer.py

branch
eric7-maintenance
changeset 9654
7328efba128b
parent 9549
67295777d9fe
parent 9653
e67609152c5e
child 10079
0222a480e93d
equal deleted inserted replaced
9555:88f10deec960 9654:7328efba128b
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 2
3 # Copyright (c) 2015 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2015 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the autocompletion interface to jedi. 7 Module implementing the autocompletion interface to jedi.
8 """ 8 """
12 import uuid 12 import uuid
13 13
14 from PyQt6.QtCore import QCoreApplication, QThread, QTimer, pyqtSlot 14 from PyQt6.QtCore import QCoreApplication, QThread, QTimer, pyqtSlot
15 from PyQt6.QtWidgets import QDialog, QInputDialog, QLineEdit 15 from PyQt6.QtWidgets import QDialog, QInputDialog, QLineEdit
16 16
17 from eric7 import Globals, Preferences 17 from eric7 import Preferences
18 from eric7.EricNetwork.EricJsonServer import EricJsonServer 18 from eric7.EricNetwork.EricJsonServer import EricJsonServer
19 from eric7.EricWidgets import EricMessageBox 19 from eric7.EricWidgets import EricMessageBox
20 from eric7.EricWidgets.EricApplication import ericApp 20 from eric7.EricWidgets.EricApplication import ericApp
21 from eric7.QScintilla.Editor import Editor, ReferenceItem 21 from eric7.QScintilla.Editor import Editor, ReferenceItem
22 from eric7.SystemUtilities import PythonUtilities
22 23
23 from .RefactoringPreviewDialog import RefactoringPreviewDialog 24 from .RefactoringPreviewDialog import RefactoringPreviewDialog
24 25
25 26
26 class JediServer(EricJsonServer): 27 class JediServer(EricJsonServer):
740 if "Error" in result: 741 if "Error" in result:
741 EricMessageBox.critical( 742 EricMessageBox.critical(
742 None, 743 None,
743 self.tr("Apply Refactoring"), 744 self.tr("Apply Refactoring"),
744 self.tr( 745 self.tr(
745 "<p>The refactoring could not be applied.</p>" "<p>Reason: {0}</p>" 746 "<p>The refactoring could not be applied.</p><p>Reason: {0}</p>"
746 ).format(result["ErrorString"]), 747 ).format(result["ErrorString"]),
747 ) 748 )
748 749
749 ####################################################################### 750 #######################################################################
750 ## Methods below handle the network connection 751 ## Methods below handle the network connection
812 if interpreter: 813 if interpreter:
813 client = os.path.join(os.path.dirname(__file__), "JediClient.py") 814 client = os.path.join(os.path.dirname(__file__), "JediClient.py")
814 ok, exitCode = self.startClient( 815 ok, exitCode = self.startClient(
815 interpreter, 816 interpreter,
816 client, 817 client,
817 [Globals.getPythonLibraryDirectory()], 818 [PythonUtilities.getPythonLibraryDirectory()],
818 idString=idString, 819 idString=idString,
819 environment=clientEnv, 820 environment=clientEnv,
820 ) 821 )
821 if not ok: 822 if not ok:
822 if exitCode == 42: 823 if exitCode == 42:

eric ide

mercurial