IPython Documentation

Table Of Contents

Previous topic

Module: qt.console.mainwindow

Next topic

Module: qt.console.qtconsoleapp

This Page

Module: qt.console.pygments_highlighter

2 Classes

class IPython.qt.console.pygments_highlighter.PygmentsBlockUserData(**kwds)

Bases: PySide.QtGui.QTextBlockUserData

Storage for the user data associated with each line.

__init__(**kwds)
class IPython.qt.console.pygments_highlighter.PygmentsHighlighter(parent, lexer=None)

Bases: PySide.QtGui.QSyntaxHighlighter

Syntax highlighter that uses Pygments for parsing.

__init__(parent, lexer=None)
highlightBlock(string)

Highlight a block of text.

set_style(style)

Sets the style to the specified Pygments style.

set_style_sheet(stylesheet)

Sets a CSS stylesheet. The classes in the stylesheet should correspond to those generated by:

pygmentize -S <style> -f html

Note that ‘set_style’ and ‘set_style_sheet’ completely override each other, i.e. they cannot be used in conjunction.

1 Function

IPython.qt.console.pygments_highlighter.get_tokens_unprocessed(self, text, stack=('root', ))

Split text into (tokentype, text) pairs.

Monkeypatched to store the final stack on the object itself.