Explorar el Código

Modifies the way one supplies data files to use the yaml config file

Caleb Fangmeier hace 7 años
padre
commit
96aa153634
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      filval/plotter.py

+ 5 - 1
filval/plotter.py

@@ -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(