def write_branch_data(self, file, padding="    "):
        """ Writes branch data in Graphviz DOT language.
        """
        attrs = ['%s="%s"' % (k,v) for k,v in self.branch_attr.iteritems()]
        attr_str = ", ".join(attrs)

        for br in self.case.branches:
            file.write("%s%s -> %s [%s];\n" % \
                (padding, br.from_bus.name, br.to_bus.name, attr_str))
def write_branch_data ( self , file , padding = "    " ) : attrs = [ '%s="%s"' % ( k , v ) for k , v in self . branch_attr . iteritems ( ) ] attr_str = ", " . join ( attrs ) for br in self . case . branches : file . write ( "%s%s -> %s [%s];\n" % ( padding , br . from_bus . name , br . to_bus . name , attr_str ) )
Writes branch data in Graphviz DOT language.