Skip to content

Commit

Permalink
write out task description
Browse files Browse the repository at this point in the history
  • Loading branch information
rkoschmitzky committed Jun 15, 2020
1 parent b261812 commit c1a0380
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dispatch/trixterdispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class TaskTemplate(object):
def __init__(self, name):
self.name = name
self.title = ""
self.description = ""
self.argument_defaults = {}
self.argument_processors = []
self.required_tasks = []
Expand All @@ -84,12 +85,13 @@ def __init__(self, name):

def __repr__(self):
code = "class {}(Task):".format(self.name)
code += "\n title = '{}'".format(self.title)
code += "\n argument_defaults = {}".format(self.argument_defaults)
code += "\n argument_processors = {}".format(self.argument_processors) if self.argument_processors else ""
code += "\n required_tasks = {}".format(self.required_tasks)
code += "\n title = '''{}'''".format(self.title)
code += "\n description = '''{}'''".format(self.description) if self.description else ""
code += "\n elements_id = '{}'".format(self.elements_id) if self.elements_id else ""
code += "\n argument_defaults = {}".format(self.argument_defaults) if self.argument_defaults else ""
code += "\n argument_processors = {}".format(self.argument_processors) if self.argument_processors else ""
code += "\n flags = Task.Flags.PER_ELEMENT" if self.per_element else ""
code += "\n required_tasks = {}".format(self.required_tasks)

return code

Expand Down Expand Up @@ -162,7 +164,6 @@ def _get_named_values(parent, plug_name, ignore_if_default=False):

return mapped


def dispatch(self, nodes):
submitting_node = nodes[0]
scriptnode = submitting_node.scriptNode()
Expand Down Expand Up @@ -191,6 +192,7 @@ def dispatch(self, nodes):

template.argument_defaults = argument_defaults
template.title = hierarchy_node.getChild("title").getValue()
template.description = hierarchy_node.getChild("description").getValue()
template.elements_id = hierarchy_node.getChild("elements_id").getValue()
template.per_element = hierarchy_node.getChild("per_element").getValue()

Expand Down

0 comments on commit c1a0380

Please sign in to comment.