eric6/Preferences/ConfigurationPages/EditorAPIsPage.py

Tue, 13 Apr 2021 18:02:59 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 13 Apr 2021 18:02:59 +0200
changeset 8234
fcb6b4b96274
parent 8218
7c09585bd960
permissions
-rw-r--r--

Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7780
diff changeset
3 # Copyright (c) 2006 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the Editor APIs configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
10 from PyQt5.QtCore import QDir, pyqtSlot, QFileInfo
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3484
diff changeset
11 from PyQt5.QtWidgets import QInputDialog
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 53
diff changeset
13 from E5Gui.E5Application import e5App
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
14 from E5Gui import E5MessageBox
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
15 from E5Gui.E5PathPicker import E5PathPickerModes
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
12
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
17 from .ConfigurationPageBase import ConfigurationPageBase
1d8dd9706f46 First commit after changing to Python 3.1.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
18 from .Ui_EditorAPIsPage import Ui_EditorAPIsPage
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
23
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 class EditorAPIsPage(ConfigurationPageBase, Ui_EditorAPIsPage):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Class implementing the Editor APIs configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 def __init__(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8151
diff changeset
32 super().__init__()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 self.setupUi(self)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.setObjectName("EditorAPIsPage")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
36 self.apiFilePicker.setMode(E5PathPickerModes.OpenFileMode)
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
37 self.apiFilePicker.setToolTip(self.tr(
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
38 "Press to select an API file via a selection dialog"))
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
39 self.apiFilePicker.setFilters(self.tr(
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
40 "API File (*.api);;All Files (*)"))
3186
a05eff845522 Changed all the file or directory selection buttons to QToolButton and gave them an icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
41
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
42 self.prepareApiButton.setText(self.tr("Compile APIs"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 self.__currentAPI = None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 self.__inPreparation = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 # set initial values
53
c3eb7cc1ff8b Renamed e5App to e5App.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
47 self.pluginManager = e5App().getObject("PluginManager")
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
48 self.apiAutoPrepareCheckBox.setChecked(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 Preferences.getEditor("AutoPrepareAPIs"))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
51 import QScintilla.Lexers
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52 self.apis = {}
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
53 apiLanguages = sorted(
5358
2584d0a08bf4 Finished the project specific API code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5350
diff changeset
54 [''] + list(QScintilla.Lexers.getSupportedApiLanguages()))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 for lang in apiLanguages:
5427
614e88cfbd84 Added some eye candy.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
56 self.apiLanguageComboBox.addItem(
614e88cfbd84 Added some eye candy.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
57 QScintilla.Lexers.getLanguageIcon(lang, False),
614e88cfbd84 Added some eye candy.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
58 lang)
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
59 self.__currentApiLanguage = ""
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
60 self.on_apiLanguageComboBox_activated(0)
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
61
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
62 def __apiKey(self, language, projectType):
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
63 """
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
64 Private method to generate a key for the apis dictionary.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
66 @param language programming language of the API
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
67 @type str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
68 @param projectType project type of the API
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
69 @type str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
70 @return key to be used
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
71 @rtype str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
72 """
8234
fcb6b4b96274 Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator) (batch 2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8218
diff changeset
73 key = (language, projectType) if projectType else (language, "")
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
74 return key
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
75
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 def save(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 Public slot to save the Editor APIs configuration.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 """
3025
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
80 Preferences.setEditor(
67064c71df21 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
81 "AutoPrepareAPIs",
7
c679fb30c8f3 Change code dealing with QVariant (and QSettings) to use the PyQt4 QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
82 self.apiAutoPrepareCheckBox.isChecked())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
84 language = self.apiLanguageComboBox.currentText()
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
85 projectType = self.projectTypeComboBox.itemData(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
86 self.projectTypeComboBox.currentIndex())
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
87 key = self.__apiKey(language, projectType)
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
88 self.apis[key] = self.__editorGetApisFromApiList()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
90 for (language, projectType), apis in self.apis.items():
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
91 Preferences.setEditorAPI(language, projectType, apis)
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
92
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
93 @pyqtSlot(int)
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
94 def on_projectTypeComboBox_activated(self, index):
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
95 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
96 Private slot to handle the selection of a project type.
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
97
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
98 @param index index of the selected entry
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
99 @type str
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
100 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
101 if self.__currentApiProjectTypeIndex == index:
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
102 return
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
103
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
104 self.__currentApiProjectTypeIndex = index
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
105 self.__fillApisList()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
107 @pyqtSlot(int)
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
108 def on_apiLanguageComboBox_activated(self, index):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 Private slot to fill the api listbox of the api page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
112 @param index index of the selected entry
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
113 @type int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 """
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
115 language = self.apiLanguageComboBox.itemText(index)
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
116
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
117 if self.__currentApiLanguage == language:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 return
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
119
7164
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
120 self.__fillProjectTypeComboBox(language)
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
121
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
122 def __fillProjectTypeComboBox(self, language):
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
123 """
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
124 Private slot to fill the selection of available project types for the
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
125 given language.
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
126
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
127 @param language selected API language
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
128 @type str
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
129 """
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
130 self.projectTypeComboBox.clear()
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
131
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
132 apiProjectTypes = sorted(
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
133 [("", "")] +
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
134 [(trans, ptype) for ptype, trans in
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
135 e5App().getObject("Project").getProjectTypes(language).items()
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
136 ]
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
137 )
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
138 for projectTypeStr, projectType in apiProjectTypes:
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
139 self.projectTypeComboBox.addItem(projectTypeStr, projectType)
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
140
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
141 self.__currentApiProjectTypeIndex = -1
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
142 self.__currentApiProjectType = ""
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
143
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
144 self.on_projectTypeComboBox_activated(0)
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
145
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
146 def __fillApisList(self):
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
147 """
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
148 Private slot to fill the list of API files.
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
149 """
7263
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
150 self.apis[
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
151 self.__apiKey(self.__currentApiLanguage,
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
152 self.__currentApiProjectType)
c1af2e327675 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
153 ] = self.__editorGetApisFromApiList()
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
154
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
155 self.__currentApiLanguage = self.apiLanguageComboBox.currentText()
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
156 self.__currentApiProjectType = self.projectTypeComboBox.itemData(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
157 self.projectTypeComboBox.currentIndex())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 self.apiList.clear()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
160 if not self.__currentApiLanguage:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 self.apiGroup.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 return
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 self.apiGroup.setEnabled(True)
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
165 self.deleteApiFileButton.setEnabled(False)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
166 self.addApiFileButton.setEnabled(False)
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
167 self.apiFilePicker.clear()
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
168
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
169 key = self.__apiKey(self.__currentApiLanguage,
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
170 self.__currentApiProjectType)
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
171 if key not in self.apis:
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
172 # populate on demand
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
173 self.apis[key] = Preferences.getEditorAPI(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
174 self.__currentApiLanguage,
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
175 projectType=self.__currentApiProjectType)[:]
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
176 for api in self.apis[key]:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 if api:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178 self.apiList.addItem(api)
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
179 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
180
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
181 from QScintilla.APIsManager import APIsManager
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
182 self.__currentAPI = APIsManager().getAPIs(
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
183 self.__currentApiLanguage,
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
184 projectType=self.__currentApiProjectType)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 if self.__currentAPI is not None:
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
186 self.__currentAPI.apiPreparationFinished.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
187 self.__apiPreparationFinished)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
188 self.__currentAPI.apiPreparationCancelled.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
189 self.__apiPreparationCancelled)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
190 self.__currentAPI.apiPreparationStarted.connect(
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 130
diff changeset
191 self.__apiPreparationStarted)
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
192 self.addInstalledApiFileButton.setEnabled(
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
193 len(self.__currentAPI.installedAPIFiles()) > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 self.addInstalledApiFileButton.setEnabled(False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 self.addPluginApiFileButton.setEnabled(
4830
f609a22f43bd Fixed a few code style issues detected by the updated pep8 checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
198 len(self.pluginManager.getPluginApiFiles(
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
199 self.__currentApiLanguage)) > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 def __editorGetApisFromApiList(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 Private slot to retrieve the api filenames from the list.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 @return list of api filenames (list of strings)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 apis = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 for row in range(self.apiList.count()):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 apis.append(self.apiList.item(row).text())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 return apis
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 def on_addApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 Private slot to add the api file displayed to the listbox.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 """
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
217 file = self.apiFilePicker.text()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 if file:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219 self.apiList.addItem(Utilities.toNativeSeparators(file))
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
220 self.apiFilePicker.clear()
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
221 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 def on_deleteApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 Private slot to delete the currently selected file of the listbox.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 crow = self.apiList.currentRow()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 if crow >= 0:
4554
f3428ddd577c Fixed a few style and coding issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
230 itm = self.apiList.takeItem(crow) # __IGNORE_WARNING__
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 del itm
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
232 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 def on_addInstalledApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 Private slot to add an API file from the list of installed API files
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 for the selected lexer language.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 installedAPIFiles = self.__currentAPI.installedAPIFiles()
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
241 if installedAPIFiles:
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
242 installedAPIFilesPath = QFileInfo(installedAPIFiles[0]).path()
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
243 installedAPIFilesShort = []
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
244 for installedAPIFile in installedAPIFiles:
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
245 installedAPIFilesShort.append(
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
246 QFileInfo(installedAPIFile).fileName())
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
247 file, ok = QInputDialog.getItem(
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
248 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
249 self.tr("Add from installed APIs"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
250 self.tr("Select from the list of installed API files"),
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
251 installedAPIFilesShort,
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
252 0, False)
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
253 if ok:
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
254 self.apiList.addItem(Utilities.toNativeSeparators(
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
255 QFileInfo(QDir(installedAPIFilesPath), file)
3038
7fe9a53280bd Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3025
diff changeset
256 .absoluteFilePath()))
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
257 else:
3020
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
258 E5MessageBox.warning(
542e97d4ecb3 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3010
diff changeset
259 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
260 self.tr("Add from installed APIs"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
261 self.tr("""There are no APIs installed yet."""
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
262 """ Selection is not available."""))
1118
2ff50209a57f Fixed a bug in the editor APIs page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 945
diff changeset
263 self.addInstalledApiFileButton.setEnabled(False)
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
264 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 def on_addPluginApiFileButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 Private slot to add an API file from the list of API files installed
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 by plugins for the selected lexer language.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 """
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
272 pluginAPIFiles = self.pluginManager.getPluginApiFiles(
5349
bccda3b5920a Started implementing project type specific APIs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4830
diff changeset
273 self.__currentApiLanguage)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 pluginAPIFilesDict = {}
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 for apiFile in pluginAPIFiles:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 pluginAPIFilesDict[QFileInfo(apiFile).fileName()] = apiFile
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
277 file, ok = QInputDialog.getItem(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 self,
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
279 self.tr("Add from Plugin APIs"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
280 self.tr(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 "Select from the list of API files installed by plugins"),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 sorted(pluginAPIFilesDict.keys()),
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 0, False)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 if ok:
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
285 self.apiList.addItem(Utilities.toNativeSeparators(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 pluginAPIFilesDict[file]))
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
287 self.prepareApiButton.setEnabled(self.apiList.count() > 0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 @pyqtSlot()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 def on_prepareApiButton_clicked(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 """
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
292 Private slot to prepare the API file for the currently selected
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
293 language.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 if self.__inPreparation:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 self.__currentAPI and self.__currentAPI.cancelPreparation()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 if self.__currentAPI is not None:
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
299 self.__currentAPI.prepareAPIs(
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
300 ondemand=True,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
301 rawList=self.__editorGetApisFromApiList())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 def __apiPreparationFinished(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 Private method called after the API preparation has finished.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 self.prepareApiProgressBar.reset()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 self.prepareApiProgressBar.setRange(0, 100)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 self.prepareApiProgressBar.setValue(0)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
310 self.prepareApiButton.setText(self.tr("Compile APIs"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 self.__inPreparation = False
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 def __apiPreparationCancelled(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 Private slot called after the API preparation has been cancelled.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 self.__apiPreparationFinished()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 def __apiPreparationStarted(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 Private method called after the API preparation has started.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 self.prepareApiProgressBar.setRange(0, 0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 self.prepareApiProgressBar.setValue(0)
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3186
diff changeset
325 self.prepareApiButton.setText(self.tr("Cancel compilation"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 self.__inPreparation = True
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 def saveState(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 Public method to save the current state of the widget.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
332 @return tuple containing the index of the selected lexer language
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
333 and the index of the selected project type
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
334 @rtype tuple of int and int
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
336 return (
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
337 self.apiLanguageComboBox.currentIndex(),
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
338 self.projectTypeComboBox.currentIndex()
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
339 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341 def setState(self, state):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 Public method to set the state of the widget.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 @param state state data generated by saveState
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 """
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
347 self.apiLanguageComboBox.setCurrentIndex(state[0])
3010
befeff46ec0f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2964
diff changeset
348 self.on_apiLanguageComboBox_activated(
8151
8c1445825e7b Changed code to not use QComboBox.activated[str] and QComboBoc.highlighted[str] signals but the int variants instead.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
349 self.apiLanguageComboBox.currentIndex())
7164
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
350
6da6a0a5a448 Made "MicroPython" a selectable programming language in order to not mess with the normal API selections.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
351 self.projectTypeComboBox.setCurrentIndex(state[1])
5350
57e82ffafdfc Adjusted the APIs configuration page to support project type specific API sets.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5349
diff changeset
352 self.on_projectTypeComboBox_activated(state[1])
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
354 @pyqtSlot()
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
355 def on_apiList_itemSelectionChanged(self):
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
356 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
357 Private slot to react on changes of API selections.
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
358 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
359 self.deleteApiFileButton.setEnabled(
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
360 len(self.apiList.selectedItems()) > 0)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
361
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
362 @pyqtSlot(str)
4575
464a6b049f89 Changed the Python2 debugger and Editor APIs pages to use the path picker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4554
diff changeset
363 def on_apiFilePicker_textChanged(self, txt):
3098
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
364 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
365 Private slot to handle the entering of an API file name.
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
366
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
367 @param txt text of the line edit (string)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
368 """
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
369 enable = txt != ""
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
370
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
371 if enable:
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
372 # check for already added file
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
373 for row in range(self.apiList.count()):
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
374 if txt == self.apiList.item(row).text():
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
375 enable = False
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
376 break
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
377
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
378 self.addApiFileButton.setEnabled(enable)
02ee75d31584 Fixed a bug in the APIs configuration page of the config dialog and improved its functionality.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3038
diff changeset
379
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 882
diff changeset
380
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 def create(dlg):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 Module function to create the configuration page.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 @param dlg reference to the configuration dialog
2964
84b65fb9e780 Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
386 @return reference to the instantiated page (ConfigurationPageBase)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 page = EditorAPIsPage()
880
52ed20236a1c Added the option to not use the native file dialog to prevent crashes on Linux.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
389 return page

eric ide

mercurial