Go to the documentation of this file.00001 from rosbridge_library.capability import Capability
00002
00003
00004 class UnadvertiseService(Capability):
00005
00006
00007
00008 def __init__(self, protocol):
00009
00010 Capability.__init__(self, protocol)
00011
00012
00013 protocol.register_operation("unadvertise_service", self.unadvertise_service)
00014
00015 def unadvertise_service(self, message):
00016
00017 service_name = message["service"]
00018
00019
00020 if service_name in self.protocol.external_service_list.keys():
00021 self.protocol.external_service_list[service_name].service_handle.shutdown("Unadvertise request.")
00022 del self.protocol.external_service_list[service_name]
00023 self.protocol.log("info", "Unadvertised service %s." % service_name)
00024 else:
00025 self.protocol.log("error", "Service %s has no been advertised externally." % service_name)