Beispiel #1
0
    def __init__(self, spec):
        Chain.__init__(self)
        assert (spec["Type"] == "MultiLevel")
        self.ChainSpec = spec["Chain"]
        self.Licenses = spec["Licenses"]
        for lic in self.Licenses:
            lic["Count"] = lic["MaxCount"]
        self.Tasks = {}
        for i, taskSpec in enumerate(spec["Tasks"]):
            if self.FindTaskInChain(taskSpec["Name"]) == None:
                print "MultiLevelChain: Task %s not referenced in the chain, skipping it" % taskSpec[
                    "Name"]
                continue
            task = Tasks.Create(self, taskSpec)
            task.ID = i + 1
            self.Tasks[task.Name] = task

        Chain.Initialize(self)