Commit 7ff66d28 authored by Stefan Behnel's avatar Stefan Behnel

clean up some code

parent bf7f5441
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
import os import os
import re import re
import time
import codecs import codecs
from xml.sax.saxutils import escape as html_escape
from StringIO import StringIO from StringIO import StringIO
import Version import Version
...@@ -150,8 +150,7 @@ function toggleDiv(id) { ...@@ -150,8 +150,7 @@ function toggleDiv(id) {
except KeyError: except KeyError:
code = '' code = ''
else: else:
for c, cc, html in special_chars: code = html_escape(code)
code = code.replace(c, html)
code = _parse_code(annotate, code) code = _parse_code(annotate, code)
score = (5 * calls['py_c_api'] + 2 * calls['pyx_c_api'] + score = (5 * calls['py_c_api'] + 2 * calls['pyx_c_api'] +
...@@ -183,15 +182,6 @@ _parse_code = re.compile( ...@@ -183,15 +182,6 @@ _parse_code = re.compile(
).sub ).sub
# TODO: make this cleaner
def escape(raw_string):
raw_string = raw_string.replace(u"\'", ur"’")
raw_string = raw_string.replace(u'\"', ur'"')
raw_string = raw_string.replace(u'\n', ur'<br>\n')
raw_string = raw_string.replace(u'\t', ur'\t')
return raw_string
class AnnotationItem(object): class AnnotationItem(object):
def __init__(self, style, text, tag="", size=0): def __init__(self, style, text, tag="", size=0):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment