Commit 7ef7bf17 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Try creating the report directory if it does not already exist.

parent 6ab5a6b2
......@@ -32,9 +32,10 @@ import argparse
class ArgumentType(object):
@classmethod
def directoryType(cls, path):
if not (os.path.isdir(path) and os.access(path, os.W_OK)):
raise argparse.ArgumentTypeError("'%s' is not a valid directory or is "\
"not writable" % path)
if not os.path.exists(path):
os.makedirs(path)
elif not (os.path.isdir(path) and os.access(path, os.W_OK)):
raise argparse.ArgumentTypeError("'%s' does not seem to be writable" % path)
return path
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment