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

Global: changed directory creation to only create parts w/o native variables

parent 781b96f5
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,14 @@ Make Experiments!
Release Changes
---------------
Release 1.0.10
==============
Global
------
* Changed directory creation to only create parts w/o native variables
Release 1.0.9
=============
......
......@@ -378,6 +378,9 @@ except ExpConfigError as error:
# Create target directories
def cut_dir_variable(directory):
return re.sub(os.sep + r'[^' + os.sep + r'$]*\$\{\w+\}.*$', '', directory)
# Create directory for scripts if it doesn't exist
script_dir = config['SCRIPT_DIR']
print "Script directory: '"+script_dir+"'"
......@@ -392,20 +395,28 @@ else:
# Create directory for output data if it doesn't exist
data_dir = config['DATA_DIR']
print "Data directory: '"+data_dir+"'"+(" (not created)" if not args.make_dirs else "")
data_cut = cut_dir_variable(data_dir)
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)
if data_dir != data_cut:
feedback.warning("only considering non-variable part of directory")
if not os.path.isdir(data_cut):
os.makedirs(data_cut)
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']
work_cut = cut_dir_variable(work_dir)
if work_dir != data_dir:
print "Work directory: '"+work_dir+"'"+(" (not created)" if not args.make_dirs else "")
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)
if work_dir != work_cut:
feedback.warning("only considering non-variable part of directory")
if not os.path.isdir(work_cut):
os.makedirs(work_cut)
else:
feedback.warning("work directory already exists")
......
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