Commit 9047b9e1 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

allow from workflows to overload the config parser method

parent 3bde3a69
......@@ -38,7 +38,6 @@ class ConfigArgumentParser (argparse.ArgumentParser):
continue
yield arg
def display_workflow_status(workflow, detailed=False):
if workflow.start_time: start_time = time.asctime(time.localtime(workflow.start_time))
else: start_time = "-"
......@@ -111,6 +110,7 @@ if __name__ == '__main__':
wf_instances = wfmanager.get_available_workflows()
wf_classes = []
for instance in wf_instances:
parser.convert_arg_line_to_args = instance.__class__.config_parser
wf_classes.append(instance.__class__.__name__)
# create the subparser for each applications
sub_parser = subparsers.add_parser(instance.name, help=instance.description)
......
......@@ -96,7 +96,14 @@ class Workflow(threading.Thread):
if not os.path.isdir(self.directory):
os.makedirs(self.directory, 0751)
self._serialize()
@staticmethod
def config_parser(arg_line):
for arg in arg_line.split():
if not arg.strip():
continue
yield arg
def __setstate__(self, state):
self.__dict__ = state.copy()
threading.Thread.__init__(self, name=self.name)
......
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