pilas.ejemplos.syntax.PythonHighlighter

Package pilas :: Package ejemplos :: Module syntax :: Class PythonHighlighter |
[hide private]
[frames] | no frames]

# Class PythonHighlighter

source code

    PyQt4.QtGui.QSyntaxHighlighter --+
                                     |
                                    PythonHighlighter

Syntax highlighter for the Python language.

Instance Methods | [hide private]
__init__(self, document) | source code
highlightBlock(self, text) Apply syntax highlighting to the given block of text. | source code
match_multiline(self, text, delimiter, in_state, style) Do highlighting of multi-line strings. | source code

Class Variables | [hide private]
| keywords = `['and', 'assert', 'break', 'class', 'continue', 'de`...``
| operators = `['=', '==', '!=', '<', '<=', '>', '>=', '\+', '-',`...``
| braces = `['\{', '\}', '\(', '\)', '\[', '\]',]`

Method Details | [hide private]

### match_multiline(self, text, delimiter, in_state, style) | source code
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.

Class Variable Details | [hide private]

  ### keywords Value:
      ['and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
      'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'i
      mport', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', '
      return', 'try', 'while', 'yield', 'None', 'True', 'False',]

  ### operators Value:
      ['=', '==', '!=', '<', '<=', '>', '>=', '\+', '-', '\*', '/', '//', '\
      %', '\*\*', '\+=', '-=', '\*=', '/=', '\%=', '\^', '\|', '\&', '\~', '
      >>', '<<',]