##// END OF EJS Templates
Added support for mouse clicks or laptop pads to play the slideshow.
Added support for mouse clicks or laptop pads to play the slideshow.

File last commit:

r8749:712b994d
r8920:d9c6eeb9
Show More
lexers.py
24 lines | 944 B | text/x-python | PythonLexer
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from pygments.lexers import PythonLexer, BashLexer
from pygments.lexer import bygroups, using
from pygments.token import Keyword, Operator, Text
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
class IPythonLexer(PythonLexer):
name = 'IPython'
aliases = ['ip', 'ipython']
filenames = ['*.ipy']
tokens = PythonLexer.tokens.copy()
tokens['root'] = [
(r'(\%+)(\w+)\s+(\.*)(\n)', bygroups(Operator, Keyword,
using(BashLexer), Text)),
(r'(\%+)(\w+)\b', bygroups(Operator, Keyword)),
(r'^(!)(.+)(\n)', bygroups(Operator, using(BashLexer), Text)),
] + tokens['root']