Exemplo n.º 1
0
 def get_distant_shell(self, io_handler):
     """
     :return: ascii table with columns : peer UID, Next Hop, Metric
     """
     table = []
     for i in self.get_json_routing():
         table.append((
             i,
             self.get_json_routing()[i],
             self.get_json_next_hop()[i]
         ))
     io_handler.write_line(ShellUtils.make_table(("Peer UID", "Metric", "Next Hop"), table))
Exemplo n.º 2
0
 def get_neighbours_shell(self, io_handler):
     """
     :return: ascii table with columns : Neighbour UID, Metric, Router?
     """
     table = []
     for i in self.get_json_neighbours():
         table.append((
             i,
             self.get_json_neighbours()[i],
             i in self._hellos.get_neighbours_routers()
         ))
     io_handler.write_line(ShellUtils.make_table(("Neighbour UID", "Metric", "Router?"), table))