Skip to content
Merged
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
16 changes: 3 additions & 13 deletions tensorboard/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,14 @@

import datetime
import errno
import html
import json
import os
import random
import shlex
import textwrap
import time

try:
import html

html_escape = html.escape
del html
except ImportError:
import cgi

html_escape = cgi.escape
del cgi

from tensorboard import manager


Expand Down Expand Up @@ -393,15 +383,15 @@ def _display_ipython(port, height, display_handle):
# Allow %PORT% in $TENSORBOARD_PROXY_URL
proxy_url = proxy_url.replace("%PORT%", "%d" % port)
replacements = [
("%HTML_ID%", html_escape(frame_id, quote=True)),
("%HTML_ID%", html.escape(frame_id, quote=True)),
("%JSON_ID%", json.dumps(frame_id)),
("%HEIGHT%", "%d" % height),
("%PORT%", "0"),
("%URL%", json.dumps(proxy_url)),
]
else:
replacements = [
("%HTML_ID%", html_escape(frame_id, quote=True)),
("%HTML_ID%", html.escape(frame_id, quote=True)),
("%JSON_ID%", json.dumps(frame_id)),
("%HEIGHT%", "%d" % height),
("%PORT%", "%d" % port),
Expand Down