opentps.gui.panels.scriptingPanel package

Submodules

opentps.gui.panels.scriptingPanel.pythonHighlighter module

class PythonHighlighter(parent: QTextDocument)

Bases: QSyntaxHighlighter

Syntax highlighter for the Python language.

braces = ['\\{', '\\}', '\\(', '\\)', '\\[', '\\]']
highlightBlock(text)

Apply syntax highlighting to the given block of text.

keywords = ['and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'yield', 'None', 'True', 'False']
match_multiline(text, delimiter, in_state, style)

Do highlighting of multi-line strings. delimiter should be a QRegExp for triple-single-quotes or triple-double-quotes, and in_state should be a unique integer to represent the corresponding state changes when inside those strings. Returns True if we’re still inside a multi-line string when this function is finished.

operators = ['=', '==', '!=', '<', '<=', '>', '>=', '\\+', '-', '\\*', '/', '//', '\\%', '\\*\\*', '\\+=', '-=', '\\*=', '/=', '\\%=', '\\^', '\\|', '\\&', '\\~', '>>', '<<']
format(color, style='')

Return a QTextCharFormat with the given attributes.

opentps.gui.panels.scriptingPanel.scriptingPanel module

class ScriptingFileView

Bases: QWidget

close(self) bool
class ScriptingPanel

Bases: QWidget

newScriptFile()
newScriptingWindow()
newScriptingWindowSignal

opentps.gui.panels.scriptingPanel.scriptingWindow module

class ScriptingWindow

Bases: QWidget

Module contents