Skip to content

Commit

Permalink
moves test page code to devserver.py, out of Flot
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Luft committed Feb 24, 2011
1 parent ceb41d1 commit b055c9a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pyflot/devserver.py
@@ -0,0 +1,17 @@
import os


def get_test_page(graph):
"""Renders a test page"""
templatefile = open(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'templates',
'test_page.html'))
template = templatefile.read()
template = template.replace("{{ graph.series_json|safe }}",
graph.series_json)
template = template.replace("{{ graph.options_json|safe }}",
graph.options_json)
out = open(os.path.join(os.getcwd(), 'testgraph.html'), 'w')
out.write(template)
out.close()

0 comments on commit b055c9a

Please sign in to comment.