Skip to content
Snippets Groups Projects
Commit 0a6048fd authored by aknecht2's avatar aknecht2
Browse files

Added more debug statements and fixed file_list parsing in workflow_job.

parent af2ef997
No related branches found
No related tags found
1 merge request!34Resolve "Zerone"
......@@ -512,16 +512,13 @@ class WorkflowJob(object):
passed in.
"""
arg_value = self._get_arg_value(arg_name, arg_info)
if self.debug:
print "arg_value: %s" % (arg_value,),
add_value = arg_value
if (isinstance(arg_value, str) and arg_value.startswith("$")) or arg_info["type"] == "rawfile":
arg_value = arg_value[1:]
if arg_info["type"] == "rawfile":
add_value = self.raw_files[os.path.basename(arg_value)]["file"]
elif arg_info["type"] == "file_list":
# Lists can only be loaded from inputs
add_value = []
for file_dict in inputs[arg_value]["values"]:
add_value.append(file_dict["file"].name)
else:
# Conditionally load from inputs / outputs
# This will only load the dict of information though, not
......@@ -538,6 +535,11 @@ class WorkflowJob(object):
elif arg_info["type"] == "rawfolder":
# We want just the folder name
add_value = os.path.basename(os.path.dirname(arg_value + "/"))
elif arg_info["type"] == "file_list":
add_value = []
for val in arg_value:
file_name = val[1:]
add_value.append((inputs if file_name in inputs else outputs)[file_name]["file"].name)
return add_value
def _create_arg_list(self, inputs, outputs):
......@@ -567,8 +569,10 @@ class WorkflowJob(object):
# 1. Should we add the argument name?
# 2. What's the correct value to add?
if self.debug:
print "\t%s: Loading argument: %s, info: %s" % (self, arg_name, arg_info)
print "\t%s: Loading argument: %s, info: %s, " % (self, arg_name, arg_info),
add_value = self._interpolate_value(inputs, outputs, arg_name, arg_info)
if self.debug:
print "Final value: %s" % (add_value)
# Only add arguments that have a value
if add_value is not None:
# Need to add in the arg_name and the arg_value
......
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