diff --git a/util/stats/output.py b/util/stats/output.py index 44dba5d15..f793749f7 100644 --- a/util/stats/output.py +++ b/util/stats/output.py @@ -96,10 +96,10 @@ class StatOutput(object): self.printdata(printmode=printmode) def graph(self, graphdir): - from os.path import expanduser, join as joinpath + from os.path import expanduser, isdir, join as joinpath from barchart import BarChart - from matplotlib.numerix import Float, zeros - import re + from matplotlib.numerix import Float, array, zeros + import os, re confgroups = self.jobfile.groups() ngroups = len(confgroups) @@ -130,6 +130,8 @@ class StatOutput(object): raise AttributeError, 'No group selected for graph bars' directory = expanduser(graphdir) + if not isdir(directory): + os.mkdir(directory) html = file(joinpath(directory, '%s.html' % self.name), 'w') print >>html, '' print >>html, '