def main(self, *, args): with NodeStrategy(args) as node: node_names = get_node_names(node=node, include_hidden_nodes=True) if args.node_name in (n.full_name for n in node_names): with DirectNode(args) as node: print(args.node_name) subscribers = get_subscriber_info( node=node, remote_node_name=args.node_name) print(' Subscribers:') print_names_and_types(subscribers) publishers = get_publisher_info( node=node, remote_node_name=args.node_name) print(' Publishers:') print_names_and_types(publishers) services = get_service_info(node=node, remote_node_name=args.node_name) print(' Services:') print_names_and_types(services) actions_servers = get_action_server_info( node=node, remote_node_name=args.node_name) print(' Action Servers:') print_names_and_types(actions_servers) actions_clients = get_action_client_info( node=node, remote_node_name=args.node_name) print(' Action Clients:') print_names_and_types(actions_clients) else: return "Unable to find node '" + args.node_name + "'"
def main(self, *, args): with NodeStrategy(args) as node: node_names = get_node_names( node=node, include_hidden_nodes=args.include_hidden) count = [n.full_name for n in node_names].count(args.node_name) if count > 1: print(INFO_NONUNIQUE_WARNING_TEMPLATE.format( num_nodes=count, node_name=args.node_name), file=sys.stderr) if count > 0: with DirectNode(args) as node: print(args.node_name) subscribers = get_subscriber_info( node=node, remote_node_name=args.node_name, include_hidden=args.include_hidden) print(' Subscribers:') print_names_and_types(subscribers) publishers = get_publisher_info( node=node, remote_node_name=args.node_name, include_hidden=args.include_hidden) print(' Publishers:') print_names_and_types(publishers) service_servers = get_service_server_info( node=node, remote_node_name=args.node_name, include_hidden=args.include_hidden) print(' Service Servers:') print_names_and_types(service_servers) service_clients = get_service_client_info( node=node, remote_node_name=args.node_name, include_hidden=args.include_hidden) print(' Service Clients:') print_names_and_types(service_clients) actions_servers = get_action_server_info( node=node, remote_node_name=args.node_name, include_hidden=args.include_hidden) print(' Action Servers:') print_names_and_types(actions_servers) actions_clients = get_action_client_info( node=node, remote_node_name=args.node_name, include_hidden=args.include_hidden) print(' Action Clients:') print_names_and_types(actions_clients) else: return "Unable to find node '" + args.node_name + "'"