Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moves test page code to devserver.py, out of Flot
- Loading branch information
Brian Luft
committed
Feb 24, 2011
1 parent
ceb41d1
commit b055c9a
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |