RefactoringRope/ConfigurationPage/AutoCompletionRopePage.py

Mon, 22 Jun 2020 18:08:10 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 22 Jun 2020 18:08:10 +0200
changeset 335
9438c2ed7732
parent 326
67bcde9c65b9
child 346
877cac2e8d94
permissions
-rw-r--r--

Removed support for Python2.

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
326
67bcde9c65b9 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 320
diff changeset
3 # Copyright (c) 2008 - 2020 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 Autocompletion 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
151
5260100b6700 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
10 from __future__ import unicode_literals
5260100b6700 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
11
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
12 from PyQt5.QtCore import pyqtSlot
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
13
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 302
diff changeset
14 from Preferences.ConfigurationPages.ConfigurationPageBase import (
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
15 ConfigurationPageBase
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 302
diff changeset
16 )
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
17 from .Ui_AutoCompletionRopePage import Ui_AutoCompletionRopePage
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
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
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
20 class AutoCompletionRopePage(ConfigurationPageBase, Ui_AutoCompletionRopePage):
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 """
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 Class implementing the Rope Autocompletion 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
23 """
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
24 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
25 """
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
26 Constructor
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 @param plugin reference to the plugin object
205
55bba6be2cbc Corrected some source documentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 191
diff changeset
29 @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
30 """
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
31 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
32 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
33 self.setObjectName("AutoCompletionRopePage")
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
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.__plugin = 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
36
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
37 # 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
38 self.ropeAutocompletionCheckBox.setChecked(
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
39 self.__plugin.getPreferences("CodeAssistEnabled"))
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
40 self.acMaxfixesSpinBox.setValue(
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
41 self.__plugin.getPreferences("MaxFixes"))
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
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 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
44 """
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 Public slot to save the Rope Autocompletion 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
46 """
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
47 self.__plugin.setPreferences(
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
48 "CodeAssistEnabled", self.ropeAutocompletionCheckBox.isChecked())
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
49 self.__plugin.setPreferences(
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
50 "MaxFixes", self.acMaxfixesSpinBox.value())
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
51
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
52 def polishPage(self):
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
53 """
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
54 Public slot to perform some polishing actions.
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
55 """
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
56 names = self.__plugin.getCodeAssistServer().connectionNames()
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
57 self.python3Button.setEnabled("Python3" in names)
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
58
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
59 @pyqtSlot()
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
60 def on_python3Button_clicked(self):
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
61 """
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
62 Private slot to edit the rope configuration for Python 3.
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
63 """
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 205
diff changeset
64 self.__plugin.getCodeAssistServer().editConfig("Python3")

eric ide

mercurial