(self)
return ''.join(chain(ins, outs))
Gets the relations between pins as a string.
Gets the relations between pins as a string.
Gets the relations between pins as a string .
def get_relations(self) -> str:
        """ Gets the relations between pins as a string. """
        # generator expressions are cool
        ins = ('{} -> {}\n'.format(block.title, in_pin.origin.end.block.title)
               for block in self.block_div.children
               for in_pin in block.input_pins if in_pin.origin)
        outs = ('{} <- {}\n'.format(block.title, destination.start.block.title)
                for block in self.block_div.children
                for out_pin in block.output_pins
                for destination in out_pin.destinations)

        return ''.join(chain(ins, outs))
def get_relations ( self ) -> str : # generator expressions are cool ins = ( '{} -> {}\n' . format ( block . title , in_pin . origin . end . block . title ) for block in self . block_div . children for in_pin in block . input_pins if in_pin . origin ) outs = ( '{} <- {}\n' . format ( block . title , destination . start . block . title ) for block in self . block_div . children for out_pin in block . output_pins for destination in out_pin . destinations ) return '' . join ( chain ( ins , outs ) )