Tue, 03 Sep 2024 17:27:20 +0200
Extended the eric plug-in wizard to support the latest header extension.
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
10439
21c28b0f9e41
Updated copyright for 2024.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10417
diff
changeset
|
3 | # Copyright (c) 2014 - 2024 Detlev Offenbach <detlev@die-offenbachs.de> |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the various plug-in templates. |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | mainTemplate = '''# -*- coding: utf-8 -*- |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | # Copyright (c) {year} {author} <{email}> |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | # |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | Module documentation goes here. |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | |
10800
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
19 | {apiImports}\ |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
20 | from PyQt6.QtCore import QObject |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | {config0}\ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | # Start-Of-Header |
10061
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
24 | __header__ = {{ |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
25 | "name": "{name}", |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
26 | "author": "{author} <{email}>", |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
27 | "autoactivate": {autoactivate}, |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
28 | "deactivateable": {deactivateable}, |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
29 | "version": "{version}", |
10283
897faacbeba5
Corrected the eric plugin wizard templates.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10252
diff
changeset
|
30 | {onDemand}\ |
10061
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
31 | "className": "{className}", |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
32 | "packageName": "{packageName}", |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
33 | "shortDescription": "{shortDescription}", |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
34 | "longDescription": ( |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
35 | """{longDescription}""" |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
36 | ), |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
37 | "needsRestart": {needsRestart}, |
10906
a398053bede2
Extended the eric plug-in wizard to support the latest header extension.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10807
diff
changeset
|
38 | "hasCompiledForms": {hasCompiledForms}, |
10061
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
39 | "pyqtApi": 2, |
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
40 | }} |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | # End-Of-Header |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | |
10061
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
43 | error = "" # noqa: U200 |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
44 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | {modulesetup}\ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | {exeData}\ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | {apiFiles}\ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | {preview}\ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | {config1}\ |
10800
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
51 | {clearPrivateData}\ |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | class {className}(QObject): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | Class documentation goes here. |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | """ |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
56 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | {config2}\ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | def __init__(self, ui): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | Constructor |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
61 | |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
62 | @param ui reference to the user interface object |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
63 | @type UI.UserInterface |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | """ |
10284
83cc3ab2a612
Corrected the eric plugin wizard templates.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10283
diff
changeset
|
65 | super().__init__(ui) |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | self.__ui = ui |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
67 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | def activate(self): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | """ |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
70 | Public method to activate this plug-in. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
71 | |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
72 | @return tuple of None and activation status |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
73 | @rtype bool |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
75 | global error |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
76 | error = "" # clear previous error |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
77 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | return None, True |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
79 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | def deactivate(self): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | """ |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
82 | Public method to deactivate this plug-in. |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | pass |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
85 | {config3}\ |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
86 | {installDependencies}''' |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
88 | configTemplate0 = """from eric7 import Preferences |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
90 | """ |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | |
10800
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
92 | configTemplate1 = '''def pageCreationFunction(configDlg): |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
93 | """ |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
94 | Function to create the Translator configuration page. |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
95 | |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
96 | @param configDlg reference to the configuration dialog |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
97 | @type ConfigurationWidget |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
98 | @return reference to the configuration page |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
99 | @rtype TranslatorPage |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
100 | """ |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
101 | page = None # change this line to create the configuration page |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
102 | return page |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
103 | |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
104 | |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
105 | def getConfigData(): |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
107 | Function returning data as required by the configuration dialog. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
108 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
109 | @return dictionary containing the relevant data |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
110 | @rtype dict |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | return {{ |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
113 | "<unique key>": [ |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
114 | "<display string>", |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
115 | "<pixmap filename>", |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
116 | pageCreationFunction, |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
117 | None, |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
118 | None, |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
119 | ], |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | }} |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | def prepareUninstall(): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
125 | Function to prepare for an un-installation. |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
126 | """ |
8637
394377638256
Replaced the direct access to 'Preferences.Prefs.settings' with 'Preferences.getSettings()'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
127 | Preferences.getSettings().remove({className}.PreferencesKey) |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
128 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
130 | ''' |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
132 | configTemplate2 = """ PreferencesKey = "{preferencesKey}" |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
133 | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
134 | """ |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
136 | configTemplate3 = ''' |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | def getPreferences(self, key): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | """ |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
139 | Public method to retrieve the various settings values. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
140 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | @param key the key of the value to get |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
142 | @type str |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
143 | @return the requested setting value |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10284
diff
changeset
|
144 | @rtype Any |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
145 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
146 | return None |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
147 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
148 | def setPreferences(self, key, value): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
149 | """ |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
150 | Public method to store the various settings values. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
151 | |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
152 | @param key the key of the setting to be set |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
153 | @type str |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
154 | @param value the value to be set |
10417
c6011e501282
Modernized some code and converted Debug Client and Debugger source code documentation to the new style.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10284
diff
changeset
|
155 | @type Any |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
156 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | pass |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
158 | ''' |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | |
10283
897faacbeba5
Corrected the eric plugin wizard templates.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10252
diff
changeset
|
160 | onDemandTemplate = """" pluginType": "{pluginType}", |
10061
8bdad5699288
Introduced a new style for the plugin header.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9653
diff
changeset
|
161 | "pluginTypename": "{pluginTypename}", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
162 | """ |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
163 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
164 | previewPixmapTemplate = '''def previewPix(): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
165 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
166 | Function to return a preview pixmap. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
167 | |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
168 | @return preview pixmap |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
169 | @rtype QPixmap |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
170 | """ |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
171 | from PyQt6.QtGui import QPixmap |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
172 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
173 | fname = "preview.png" |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
174 | return QPixmap(fname) |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
175 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
177 | ''' |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
178 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
179 | exeDisplayDataListTemplate = '''def exeDisplayDataList(): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
180 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
181 | Function to support the display of some executable info. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
182 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | @return list of dictionaries containing the data to query the presence of |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | the executable |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
185 | @rtype list of dict |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
187 | dataList = [] |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | data = { |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | "programEntry": True, |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | "header": "<translated header string>", |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
191 | "exe": "dummyExe", |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
192 | "versionCommand": "--version", |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
193 | "versionStartsWith": "dummyExe", |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
194 | "versionRe": "", |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
195 | "versionPosition": -1, |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
196 | "version": "", |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
197 | "versionCleanup": None, |
6479
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
198 | "exeModule": None, |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | } |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
200 | for exePath in ["exe1", "exe2"]: |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
201 | data["exe"] = exePath |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
202 | data["versionStartsWith"] = "<identifier>" |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | dataList.append(data.copy()) |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | return dataList |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
206 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | ''' |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | exeDisplayDataTemplate = '''def exeDisplayData(): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
211 | Function to support the display of some executable info. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
212 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
213 | @return dictionary containing the data to query the presence of |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
214 | the executable |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
215 | @rtype dict |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
216 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
217 | data = { |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | "programEntry": True, |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | "header": "<translated header string>", |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | "exe": exe, |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | "versionCommand": "--version", |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | "versionStartsWith": "<identifier>", |
10252
64660db96a7a
Eric Plugin Wizard:
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10061
diff
changeset
|
223 | "versionRe": None, |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
224 | "versionPosition": -1, |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
225 | "version": "", |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | "versionCleanup": None, |
6479
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
227 | "exeModule": None, |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
228 | } |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
229 | |
6479
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
230 | return data |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
231 | |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
232 | |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
233 | ''' |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
234 | |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
235 | exeDisplayDataInfoTemplate = '''def exeDisplayData(): |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
236 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
237 | Function to support the display of some executable info. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
238 | |
6479
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
239 | @return dictionary containing the data to be shown |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
240 | @rtype dict |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
241 | """ |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
242 | data = { |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
243 | "programEntry": False, |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
244 | "header": "<translated header string>", |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
245 | "text": "<translated entry string>", |
2ae32c9f9792
PluginWizardDialog: corrected existing templates and added template and button for an exeDisplayData() function returning ready made version info.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6069
diff
changeset
|
246 | "version": "", |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | } |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
248 | |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
249 | return data |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | ''' |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | moduleSetupTemplate = '''def moduleSetup(): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
255 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
256 | Function to perform module level setup. |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
257 | """ |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
258 | pass |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
260 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | ''' |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | apiFilesTemplate = '''def apiFiles(language): |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
264 | """ |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
265 | Function to return the API files made available by this plug-in. |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
266 | |
6069
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
267 | @param language language to get APIs for |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
268 | @type str |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
269 | @return list of API filenames |
25114fbfb731
Corrected some template code in the eric plug-in wizard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
270 | @rtype list of str |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
271 | """ |
9433
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
272 | if language in ("Python3", "Python"): |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
273 | apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python") |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
274 | apis = glob.glob(os.path.join(apisDir, "*.api")) |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
275 | apisDir = os.path.join(os.path.dirname(__file__), "APIs", "Python3") |
6df1aeaa4529
Adjusted some wizard code generators to output Black compatible code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
276 | apis.extend(glob.glob(os.path.join(apisDir, "*.api"))) |
6016
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
277 | else: |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
278 | apis = [] |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
279 | return apis |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
280 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
281 | |
3d594f66a7f7
Added the eric plug-in wizard plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
282 | ''' |
7258
aff39db4dacc
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
283 | |
10807
4bcd4e08418f
Corrected some code formatting issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10800
diff
changeset
|
284 | apiImportsTemplate = """import glob |
10800
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
285 | import os |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
286 | |
10807
4bcd4e08418f
Corrected some code formatting issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10800
diff
changeset
|
287 | """ |
10800
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
288 | |
10797
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
289 | installDependenciesTemplate = ''' |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
290 | |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
291 | def installDependencies(pipInstall): |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
292 | """ |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
293 | Function to install dependencies of this plug-in. |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
294 | |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
295 | @param pipInstall function to be called with a list of package names. |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
296 | @type function |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
297 | """ |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
298 | pass |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
299 | ''' |
81f885140d2b
Extended the EricPlugin wizard to be able to create an 'installDependencies()' function skeleton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
300 | |
10800
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
301 | clearPrivateDataTemplate = '''def clearPrivateData(): |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
302 | """ |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
303 | Function to clear the private data of the plug-in. |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
304 | """ |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
305 | pass |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
306 | |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
307 | |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
308 | ''' |
c6ce5522be30
Extended the EricPlugin wizard to be able to create more function skeletons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10797
diff
changeset
|
309 | |
7258
aff39db4dacc
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
310 | # |
aff39db4dacc
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
311 | # eflag: noqa = M841 |