Make ostgraph create an outdir if specified and it does not already exist.

This commit is contained in:
Justin Clark-Casey
2014-09-18 20:57:15 +01:00
parent 528bd10af1
commit 2c9ee8d67f
@@ -2,6 +2,8 @@
import argparse
import json
import os
import os.path
import matplotlib.pyplot as plt
import sys
from pylab import *
@@ -95,6 +97,9 @@ for path in opt.statsLogPath:
if "batch" in opt:
batchCommands = json.load(open(opt.batch))
if not os.path.exists(opt.outdir):
os.mkdir(opt.outdir)
for graph in batchCommands["graphs"]:
select = graph["select"]
@@ -134,4 +139,4 @@ else:
else:
outPath = None
produceGraph("*", opt.select, opt.type, opt.action, show, save, outPath)
produceGraph("*", opt.select, opt.type, opt.action, show, save, outPath)