def find_cluster_summary(txt): "Find and return the cluster summary record if it exists" b = txt.find("[cluster-summary") if b < 0: # Older seqexec used this name b = txt.find("[seqexec-summary") if b >= 0: e = txt.find("]", b) if e < 0: raise JobFailed("Invalid cluster-summary record") return RecordParser(txt[b:e + 1]).parse() # If we found a cluster-task, but no cluster-summary, then there is a problem b = txt.find("[cluster-task") if b >= 0: raise JobFailed("cluster-summary is missing") return None
def parse(self, string): parser = RecordParser(string) return parser.parse()