RefactoringRope/ConfigurationPage/CallTipsRopePage.py

Mon, 17 Oct 2022 16:45:23 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 17 Oct 2022 16:45:23 +0200
branch
eric7
changeset 394
b34f5dd3db27
parent 389
4f53795beff0
child 396
933b8fcd854f
permissions
-rw-r--r--

Enhanced the default configuration handling (for refactoring and code assist).

100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
374
958f34e97952 Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 347
diff changeset
3 # Copyright (c) 2008 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Rope Calltips configuration page.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
394
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
10 from PyQt6.QtCore import pyqtSlot
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
11
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
12 from Preferences.ConfigurationPages.ConfigurationPageBase import ConfigurationPageBase
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13 from .Ui_CallTipsRopePage import Ui_CallTipsRopePage
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
15
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 class CallTipsRopePage(ConfigurationPageBase, Ui_CallTipsRopePage):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 Class implementing the Rope Calltips configuration page.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 """
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
20
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 def __init__(self, plugin):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Constructor
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
24
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 @param plugin reference to the plugin object
205
55bba6be2cbc Corrected some source documentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 151
diff changeset
26 @type RefactoringRopePlugin
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 ConfigurationPageBase.__init__(self)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 self.setupUi(self)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 self.setObjectName("CallTipsRopePage")
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
31
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.__plugin = plugin
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
33
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 # set initial values
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 self.ropeCalltipsCheckBox.setChecked(
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
36 self.__plugin.getPreferences("CodeAssistCalltipsEnabled")
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
37 )
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.ctMaxfixesSpinBox.setValue(
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
39 self.__plugin.getPreferences("CalltipsMaxFixes")
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
40 )
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
41
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42 def save(self):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 Public slot to save the Rope Calltips configuration.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 self.__plugin.setPreferences(
389
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
47 "CodeAssistCalltipsEnabled", self.ropeCalltipsCheckBox.isChecked()
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
48 )
4f53795beff0 Reformatted source code with 'Black'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 374
diff changeset
49 self.__plugin.setPreferences("CalltipsMaxFixes", self.ctMaxfixesSpinBox.value())
394
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
50
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
51 def polishPage(self):
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
52 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
53 Public slot to perform some polishing actions.
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
54 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
55 names = self.__plugin.getCodeAssistServer().connectionNames()
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
56 self.createPython3Button.setEnabled("Python3" in names)
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
57 self.editPython3Button.setEnabled("Python3" in names)
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
58
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
59 @pyqtSlot()
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
60 def on_editPython3Button_clicked(self):
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
61 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
62 Private slot to edit the rope configuration for Python 3.
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
63 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
64 self.__plugin.getCodeAssistServer().editConfig("Python3")
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
65
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
66 @pyqtSlot()
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
67 def on_createPython3Button_clicked(self):
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
68 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
69 Private slot to create a new default rope configuration for Python 3.
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
70 """
b34f5dd3db27 Enhanced the default configuration handling (for refactoring and code assist).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 389
diff changeset
71 self.__plugin.getCodeAssistServer().createConfig("Python3")

eric ide

mercurial