def lookup_uri(master, system_state, topic, uri): for l in system_state[0:2]: for entry in l: if entry[0] == topic: for n in entry[1]: if rostopic.get_api(master, n) == uri: return '%s (%s)' % (n, uri) return uri
def lookup_uri(self, master, system_state, topic, uri): """ Find the node (URI) subscribing or publishing to topic from uri. """ for l in system_state[0:2]: for entry in l: if entry[0] == topic: for n in entry[1]: if rostopic.get_api(master, n) == uri: return n