Procházet zdrojové kódy

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

Caleb Fangmeier před 6 roky
rodič
revize
96aa153634
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  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(