Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ env:
- TOX_ENV=py32
- TOX_ENV=py33
- TOX_ENV=py34
- TOX_ENV=py35
- TOX_ENV=py36
- TOX_ENV=py37
- TOX_ENV=py38

install:
- pip install tox
Expand Down
10 changes: 7 additions & 3 deletions src/greplin/scales/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@

from greplin import scales

import cgi
try:
import html
except ImportError:
# Python 2.7 has no html module
import cgi as html
import six
import json
import operator
Expand Down Expand Up @@ -105,7 +109,7 @@ def _htmlRenderDict(pathParts, statDict, output):

output.write('<div class="level">')
for key in keys:
keyStr = cgi.escape(_utf8str(key))
keyStr = html.escape(_utf8str(key))
value = statDict[key]
if hasattr(value, '__call__'):
value = value()
Expand All @@ -119,7 +123,7 @@ def _htmlRenderDict(pathParts, statDict, output):
_htmlRenderDict(valuePath, value, output)
else:
output.write('<div><span class="key">%s</span> <span class="%s">%s</span></div>' %
(keyStr, type(value).__name__, cgi.escape(_utf8str(value)).replace('\n', '<br/>')))
(keyStr, type(value).__name__, html.escape(_utf8str(value)).replace('\n', '<br/>')))

if links:
for link in links:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[tox]
envlist = py27, pypy, py32, py33, py34
envlist = py27, pypy, py32, py33, py34, py35, py36, py37, py38
[testenv]
commands=python setup.py test