Wed, 13 Jul 2022 14:55:47 +0200
Reformatted the source code using the 'Black' utility.
7998 | 1 | # -*- coding: utf-8 -*- |
2 | ||
8881
54e42bc2437a
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
3 | # Copyright (c) 2021 - 2022 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 ( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
23 | "Python", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
24 | "Python3", |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
25 | "MicroPython", |
7998 | 26 | ): |
27 | from .PyDocstringGenerator import PyDocstringGenerator | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
28 | |
7998 | 29 | return PyDocstringGenerator(editor) |
30 | else: | |
31 | from .BaseDocstringGenerator import BaseDocstringGenerator | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
32 | |
7998 | 33 | return BaseDocstringGenerator(editor) |
34 | ||
35 | ||
36 | def getSupportedDocstringTypes(): | |
37 | """ | |
38 | 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
|
39 | |
7998 | 40 | @return list of tuples with supported docstring type/style and the |
41 | corresponding display string | |
42 | @rtype tuple of (str, str) | |
43 | """ | |
44 | return [ | |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
45 | ("ericdoc", QCoreApplication.translate("DocstringGenerator", "Eric")), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
46 | ("numpydoc", QCoreApplication.translate("DocstringGenerator", "NumPy")), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
47 | ("googledoc", QCoreApplication.translate("DocstringGenerator", "Google")), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
48 | ("sphinxdoc", QCoreApplication.translate("DocstringGenerator", "Sphinx")), |
7998 | 49 | ] |