|
@@ -81,7 +81,8 @@ def decl_plot(fn):
|
|
|
|
|
|
def generate_dashboard(plots, title, output='dashboard.html', template='dashboard.j2', source_file=None):
|
|
|
from jinja2 import Environment, PackageLoader, select_autoescape
|
|
|
- from os.path import join
|
|
|
+ from os.path import join, isdir
|
|
|
+ from os import mkdir
|
|
|
from urllib.parse import quote
|
|
|
|
|
|
env = Environment(
|
|
@@ -105,6 +106,9 @@ def generate_dashboard(plots, title, output='dashboard.html', template='dashboar
|
|
|
else:
|
|
|
source = "# Not supplied!!"
|
|
|
|
|
|
+ if not isdir('output'):
|
|
|
+ mkdir('output')
|
|
|
+
|
|
|
with open(join('output', output), 'w') as tempout:
|
|
|
templ = env.get_template(template)
|
|
|
tempout.write(templ.render(
|