Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #385 from fchapoton/patch-9
Browse files Browse the repository at this point in the history
correct bad syntax in arguments of call in colorize
  • Loading branch information
novoselt committed May 22, 2016
2 parents 23e3e10 + 5e9abdb commit 79b4e1f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sagenb/notebook/colorize.py
Expand Up @@ -78,9 +78,12 @@ def format(self, formatter, form):
msg, self.raw[self.lines[line]:]))


def __call__(self, toktype, toktext, (srow,scol), (erow,ecol), line):
""" Token handler.
def __call__(self, toktype, toktext, srow_scol, erow_ecol, line):
"""
Token handler.
"""
srow, scol = srow_scol
erow, ecol = erow_ecol
if 0:
txt = "type {} {} text {} start {} {} end {} {} <br/>"
print(txt.format(toktype, token.tok_name[toktype], toktext,
Expand Down Expand Up @@ -123,8 +126,9 @@ def __call__(self, toktype, toktext, (srow,scol), (erow,ecol), line):


def colorize(source):
import os, sys
# write colorized version to "[filename].py.html"
"""
write colorized version to "[filename].py.html"
"""
html = cStringIO.StringIO()
Parser(source, html).format(None, None)
html.flush()
Expand Down

0 comments on commit 79b4e1f

Please sign in to comment.