Commit da2cc6b6 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Use get_command function to get program name

parent 0203c77b
......@@ -51,7 +51,10 @@ class Component(object):
self.output_directory = None
self.description = None
self.config_reader = JFlowConfigReader()
self.prg_name = self.get_prg_name()
try:
self.prg_name = self.get_command()
except NotImplementedError:
self.prg_name = self.__class__.__name__
self.version = self.get_version()
if isinstance(self.version, bytes):
self.version = self.version.decode()
......
......@@ -611,18 +611,18 @@ class Workflow(threading.Thread):
descriptions = self.get_description_per_components()
idx = 1
for component, program in programs.items():
name = component[:component.index(".")]
component = str(idx) + ". "
name = component
component_str = str(idx) + ". "
if component in descriptions and descriptions[component] is not None:
component += descriptions[component]
component_str += descriptions[component]
else:
component += name
component += ":\n"
component += "\t- Program: {0}\n".format(program["name"])
component += "\t- Version: {0}\n".format(program["version"])
component += "\t- Parameters: {0}\n".format(", ".join(program["parameters"])
component_str += name
component_str += ":\n"
component_str += "\t- Program: {0}\n".format(program["name"])
component_str += "\t- Version: {0}\n".format(program["version"])
component_str += "\t- Parameters: {0}\n".format(", ".join(program["parameters"])
if len(program["parameters"]) > 0 else "None")
print(component)
print(component_str)
idx += 1
def get_description_per_components(self):
......@@ -644,7 +644,7 @@ class Workflow(threading.Thread):
version = current_component.version
if version:
program = {
"name": current_component.get_prg_name(),
"name": current_component.prg_name,
"version": version,
"parameters": []
}
......
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