File: qgscodeeditor.py

package info (click to toggle)
qgis 3.44.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,237,544 kB
  • sloc: cpp: 1,668,420; python: 381,688; xml: 23,474; perl: 4,078; sh: 3,733; ansic: 2,799; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 155
file content (78 lines) | stat: -rw-r--r-- 4,644 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# The following has been generated automatically from src/gui/codeeditors/qgscodeeditor.h
# monkey patching scoped based enum
QgsCodeEditor.Mode.ScriptEditor.__doc__ = "Standard mode, allows for display and edit of entire scripts"
QgsCodeEditor.Mode.OutputDisplay.__doc__ = "Read only mode for display of command outputs"
QgsCodeEditor.Mode.CommandInput.__doc__ = "Command input mode"
QgsCodeEditor.Mode.__doc__ = """Code editor modes.

.. versionadded:: 3.30

* ``ScriptEditor``: Standard mode, allows for display and edit of entire scripts
* ``OutputDisplay``: Read only mode for display of command outputs
* ``CommandInput``: Command input mode

"""
# --
QgsCodeEditor.Mode.baseClass = QgsCodeEditor
# monkey patching scoped based enum
QgsCodeEditor.LineNumbers = QgsCodeEditor.MarginRole.LineNumbers
QgsCodeEditor.LineNumbers.is_monkey_patched = True
QgsCodeEditor.LineNumbers.__doc__ = "Line numbers"
QgsCodeEditor.ErrorIndicators = QgsCodeEditor.MarginRole.ErrorIndicators
QgsCodeEditor.ErrorIndicators.is_monkey_patched = True
QgsCodeEditor.ErrorIndicators.__doc__ = "Error indicators"
QgsCodeEditor.FoldingControls = QgsCodeEditor.MarginRole.FoldingControls
QgsCodeEditor.FoldingControls.is_monkey_patched = True
QgsCodeEditor.FoldingControls.__doc__ = "Folding controls"
QgsCodeEditor.MarginRole.__doc__ = """Margin roles.

This enum contains the roles which the different numbered margins are used for.

.. versionadded:: 3.16

* ``LineNumbers``: Line numbers
* ``ErrorIndicators``: Error indicators
* ``FoldingControls``: Folding controls

"""
# --
QgsCodeEditor.MarginRole.baseClass = QgsCodeEditor
# monkey patching scoped based enum
QgsCodeEditor.Flag.CodeFolding.__doc__ = "Indicates that code folding should be enabled for the editor"
QgsCodeEditor.Flag.ImmediatelyUpdateHistory.__doc__ = "Indicates that the history file should be immediately updated whenever a command is executed, instead of the default behavior of only writing the history on widget close \n.. versionadded:: 3.32"
QgsCodeEditor.Flag.__doc__ = """Flags controlling behavior of code editor

.. versionadded:: 3.28

* ``CodeFolding``: Indicates that code folding should be enabled for the editor
* ``ImmediatelyUpdateHistory``: Indicates that the history file should be immediately updated whenever a command is executed, instead of the default behavior of only writing the history on widget close

  .. versionadded:: 3.32


"""
# --
QgsCodeEditor.Flag.baseClass = QgsCodeEditor
QgsCodeEditor.Flags.baseClass = QgsCodeEditor
Flags = QgsCodeEditor  # dirty hack since SIP seems to introduce the flags in module
try:
    QgsCodeEditor.__attribute_docs__ = {'SEARCH_RESULT_INDICATOR': 'Indicator index for search results', 'sessionHistoryCleared': 'Emitted when the history of commands run in the current session is\ncleared.\n\n.. versionadded:: 3.30\n', 'persistentHistoryCleared': 'Emitted when the persistent history of commands run in the editor is\ncleared.\n\n.. versionadded:: 3.30\n', 'helpRequested': 'Emitted when documentation was requested for the specified ``word``.\n\n.. versionadded:: 3.42\n', 'editingTimeout': 'Emitted when either:\n\n1. 1 second has elapsed since the last text change in the widget\n2. or, immediately after the widget has lost focus after its text was changed.\n\n.. seealso:: :py:func:`editingTimeoutInterval`\n\n.. versionadded:: 3.42\n'}
    QgsCodeEditor.__annotations__ = {'SEARCH_RESULT_INDICATOR': int}
    QgsCodeEditor.languageToString = staticmethod(QgsCodeEditor.languageToString)
    QgsCodeEditor.defaultColor = staticmethod(QgsCodeEditor.defaultColor)
    QgsCodeEditor.color = staticmethod(QgsCodeEditor.color)
    QgsCodeEditor.setColor = staticmethod(QgsCodeEditor.setColor)
    QgsCodeEditor.getMonospaceFont = staticmethod(QgsCodeEditor.getMonospaceFont)
    QgsCodeEditor.isFixedPitch = staticmethod(QgsCodeEditor.isFixedPitch)
    QgsCodeEditor.__virtual_methods__ = ['language', 'languageCapabilities', 'moveCursorToStart', 'moveCursorToEnd', 'checkSyntax', 'toggleComment', 'initializeLexer', 'populateContextMenu', 'reformatCodeString', 'showMessage']
    QgsCodeEditor.__overridden_methods__ = ['callTip', 'setText', 'focusOutEvent', 'keyPressEvent', 'contextMenuEvent', 'eventFilter']
    QgsCodeEditor.__signal_arguments__ = {'helpRequested': ['word: str']}
    QgsCodeEditor.__group__ = ['codeeditors']
except (NameError, AttributeError):
    pass
try:
    QgsCodeInterpreter.__virtual_methods__ = ['currentState']
    QgsCodeInterpreter.__abstract_methods__ = ['promptForState', 'execCommandImpl']
    QgsCodeInterpreter.__group__ = ['codeeditors']
except (NameError, AttributeError):
    pass