Skip to content

Commit

Permalink
dispatcher generates title and elements_id as string
Browse files Browse the repository at this point in the history
  • Loading branch information
rkoschmitzky committed Jun 12, 2020
1 parent 00c4ba4 commit c9cc96a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dispatch/trixterdispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,18 @@ def __init__(self, iterable):
class TaskTemplate(object):
def __init__(self, name):
self.name = name
self.title = ""
self.argument_processors = []
self.required_tasks = []
self.elements_id = ""
self.per_element = False

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

return code
Expand Down Expand Up @@ -148,6 +149,7 @@ def dispatch(self, nodes):

template.argument_processors.append(processor)

template.title = hierarchy_node.getChild("title").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 c9cc96a

Please sign in to comment.