def requirement(self, requirement): '''Output one requirement - and collect information about the requirement's coherence.''' ident = " "[0:self.__level] self.__output_file.write( '%s"%s" [%s];\n' % (ident, requirement.name, graph.node_attributes(requirement))) for d in sorted(requirement.incoming, key=lambda r: r.get_id()): self.__req_dep_graph += '"%s" -> "%s";\n' \ % (requirement.get_id(), d.get_id())
def requirement(self, requirement): '''Output one requirement - and collect information about the requirement's coherence.''' ident = " "[0:self.__level] self.__output_file.write('%s"%s" [%s];\n' % (ident, requirement.name, graph.node_attributes(requirement))) for d in sorted(requirement.incoming, key=lambda r: r.get_id()): self.__req_dep_graph += '"%s" -> "%s";\n' \ % (requirement.get_id(), d.get_id())
def output_topic(self, dotfile, topic): ident = " "[0:topic.level] # The _GRAPH_ is there to differentiate between topics and # possible equally named requiremnts. dotfile.write('%ssubgraph cluster_GRAPH_%s {\n' ' label="Topic: %s";\n' % (ident, topic.name, topic.name)) # Write out the sub-sub-graphs for t in sorted(topic.outgoing, key = lambda t: t.name): self.output_topic(dotfile, t) for req in sorted(topic.reqs, key = lambda r: r.id): dotfile.write('%s"%s" [%s];\n' % (ident, req.name, graph.node_attributes(req))) dotfile.write('%s}\n' % ident)