Skip to content

Commit b055c9a

Browse files
author
Brian Luft
committed
moves test page code to devserver.py, out of Flot
1 parent ceb41d1 commit b055c9a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

pyflot/devserver.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import os
2+
3+
4+
def get_test_page(graph):
5+
"""Renders a test page"""
6+
templatefile = open(os.path.join(
7+
os.path.dirname(os.path.abspath(__file__)),
8+
'templates',
9+
'test_page.html'))
10+
template = templatefile.read()
11+
template = template.replace("{{ graph.series_json|safe }}",
12+
graph.series_json)
13+
template = template.replace("{{ graph.options_json|safe }}",
14+
graph.options_json)
15+
out = open(os.path.join(os.getcwd(), 'testgraph.html'), 'w')
16+
out.write(template)
17+
out.close()

0 commit comments

Comments
 (0)