Sat, 26 Apr 2025 12:34:32 +0200
MicroPython
- Added a configuration option to disable the support for the no longer produced Pimoroni Pico Wireless Pack.
7998 | 1 | # -*- coding: utf-8 -*- |
2 | ||
11090
f5f5f5803935
Updated copyright for 2025.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10665
diff
changeset
|
3 | # Copyright (c) 2021 - 2025 Detlev Offenbach <detlev@die-offenbachs.de> |
7998 | 4 | # |
5 | ||
6 | """ | |
7 | Package containing the documentation string generator tool. | |
8 | """ | |
9 | ||
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
|
10 | from PyQt6.QtCore import QCoreApplication |
7998 | 11 | |
12 | ||
13 | def getDocstringGenerator(editor): | |
14 | """ | |
15 | Function to get a docstring generator for the given editor. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
16 | |
7998 | 17 | @param editor reference to the editor to create a docstring generator for |
18 | @type Editor | |
19 | @return reference to the created docstring generator | |
20 | @rtype BaseDocstringGenerator | |
21 | """ | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
22 | if editor.isPyFile() or editor.getFileType() in ( |
10665
66564661c3b5
Fixed a type in the docstring generator causing 'googledoc' type to fail.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
10439
diff
changeset
|
23 | "Cython", |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
24 | "Python", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
25 | "Python3", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
26 | "MicroPython", |
7998 | 27 | ): |
11148
15e30f0c76a8
Adjusted the code to the modified issue codes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
11090
diff
changeset
|
28 | from .PyDocstringGenerator import ( # __IGNORE_WARNING_I-101__ |
9482
a2bc06a54d9d
Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
29 | PyDocstringGenerator, |
a2bc06a54d9d
Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
30 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
31 | |
7998 | 32 | return PyDocstringGenerator(editor) |
33 | else: | |
11148
15e30f0c76a8
Adjusted the code to the modified issue codes.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
11090
diff
changeset
|
34 | from .BaseDocstringGenerator import ( # __IGNORE_WARNING_I-101__ |
9482
a2bc06a54d9d
Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
35 | BaseDocstringGenerator, |
a2bc06a54d9d
Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
36 | ) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
37 | |
7998 | 38 | return BaseDocstringGenerator(editor) |
39 | ||
40 | ||
41 | def getSupportedDocstringTypes(): | |
42 | """ | |
43 | Function to get the supported docstring types/styles. | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
44 | |
7998 | 45 | @return list of tuples with supported docstring type/style and the |
46 | corresponding display string | |
47 | @rtype tuple of (str, str) | |
48 | """ | |
49 | return [ | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
50 | ("ericdoc", QCoreApplication.translate("DocstringGenerator", "Eric")), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
51 | ("numpydoc", QCoreApplication.translate("DocstringGenerator", "NumPy")), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
52 | ("googledoc", QCoreApplication.translate("DocstringGenerator", "Google")), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
53 | ("sphinxdoc", QCoreApplication.translate("DocstringGenerator", "Sphinx")), |
7998 | 54 | ] |