mirror of
https://github.com/justinccdev/opensimulator-tools.git
synced 2026-08-14 01:07:50 +00:00
Make ostgraph create an outdir if specified and it does not already exist.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user