diff options
author | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-06-10 21:16:21 -0400 |
---|---|---|
committer | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-06-10 21:16:21 -0400 |
commit | cf75a0c9d6167626e83bf78021dcb0ab067fb77b (patch) | |
tree | 7491e0d8090cf51cff2ea79a55ee7394f75c160d | |
parent | a43beaa10a61d2875b40596ee03d6ef9024fb22c (diff) |
Add --prefix option.
-rwxr-xr-x | plot.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -14,7 +14,7 @@ options = [ | |||
14 | o('-f', '--format', action='store', dest='format', type='choice', | 14 | o('-f', '--format', action='store', dest='format', type='choice', |
15 | choices=FORMATS, help='output format'), | 15 | choices=FORMATS, help='output format'), |
16 | o(None, '--save-script', action='store_true', dest='save_script'), | 16 | o(None, '--save-script', action='store_true', dest='save_script'), |
17 | 17 | o('-p', '--prefix', action='store', dest='prefix'), | |
18 | o('-e', '--experiment', action='store', dest='experiment', | 18 | o('-e', '--experiment', action='store', dest='experiment', |
19 | help="override auto-detection of experiment"), | 19 | help="override auto-detection of experiment"), |
20 | 20 | ||
@@ -33,6 +33,7 @@ defaults = { | |||
33 | 'format' : 'show', | 33 | 'format' : 'show', |
34 | 'experiment' : None, | 34 | 'experiment' : None, |
35 | 'save_script' : False, | 35 | 'save_script' : False, |
36 | 'prefix' : '', | ||
36 | 37 | ||
37 | # formatting options | 38 | # formatting options |
38 | 'paper' : False, | 39 | 'paper' : False, |
@@ -246,7 +247,7 @@ class SchedPlotter(defapp.App): | |||
246 | 247 | ||
247 | def make_plot(self, fname=None): | 248 | def make_plot(self, fname=None): |
248 | p = Plot() | 249 | p = Plot() |
249 | p.output = "%s.%s" % (fname, self.options.format) | 250 | p.output = "%s%s.%s" % (self.options.prefix, fname, self.options.format) |
250 | p.format = self.options.format | 251 | p.format = self.options.format |
251 | return p | 252 | return p |
252 | 253 | ||