DAVE.gui.helpers.highlighter¶
Module Contents¶
- DAVE.gui.helpers.highlighter.format(color, style='')¶
Return a QTextCharFormat with the given attributes.
- DAVE.gui.helpers.highlighter.STYLES¶
- class DAVE.gui.helpers.highlighter.PythonHighlighter(document)¶
Bases:
PySide2.QtGui.QSyntaxHighlighterSyntax highlighter for the Python language.
- 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']¶
- operators = ['=', '==', '!=', '<', '<=', '>', '>=', '\\+', '-', '\\*', '/', '//', '\\%', '\\*\\*', '\\+=', '-=', '\\*=', '/=', '\\%=', '\\^', '\\|', '\\&', '\\~', '>>', '<<']¶
- braces = ['\\{', '\\}', '\\(', '\\)', '\\[', '\\]']¶
- highlightBlock(self, text)¶
Apply syntax highlighting to the given block of text.
- match_multiline(self, text, delimiter, in_state, style)¶
Do highlighting of multi-line strings.
delimitershould be aQRegExpfor triple-single-quotes or triple-double-quotes, andin_stateshould 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.
- DAVE.gui.helpers.highlighter.app¶