Skip to content
Snippets Groups Projects
Commit cb910090 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

Added option to skip creation of work and data directories to allow test runs...

Added option to skip creation of work and data directories to allow test runs on other machines (--no-make-dirs/-m)
parent 6ff6ef9c
No related branches found
No related tags found
No related merge requests found
......@@ -248,6 +248,9 @@ command_line.add_argument('assigns', metavar='key=value', nargs='*',
help='override configuration file settings')
command_line.add_argument('--path', '-p',
help='search path for default config and templates')
command_line.add_argument('--no-make-dirs', '-m',
action='store_false', dest='make_dirs',
help='do not create work and data directories')
args = command_line.parse_args()
......@@ -334,20 +337,22 @@ else:
# Create directory for output data if it doesn't exist
data_dir = config['DATA_DIR']
print "Data directory: '"+data_dir+"'"
if not os.path.isdir(data_dir):
os.makedirs(data_dir)
elif not script_dir.startswith(data_dir):
feedback.warning("data directory already exists")
print "Data directory: '"+data_dir+"'"+(" (not created)" if not args.make_dirs else "")
if args.make_dirs:
if not os.path.isdir(data_dir):
os.makedirs(data_dir)
elif not script_dir.startswith(data_dir):
feedback.warning("data directory already exists")
# Create directory for running the experiment if it doesn't exist
work_dir = config['WORK_DIR']
if work_dir != data_dir:
print "Work directory: '"+work_dir+"'"
if not os.path.isdir(work_dir):
os.makedirs(work_dir)
else:
feedback.warning("work directory already exists")
print "Work directory: '"+work_dir+"'"+(" (not created)" if not args.make_dirs else "")
if args.make_dirs:
if not os.path.isdir(work_dir):
os.makedirs(work_dir)
else:
feedback.warning("work directory already exists")
# Run template expansion
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment