<s> from rosbridge_library . capability import Capability <EOL> class UnadvertiseService ( Capability ) : <EOL> def __init__ ( self , protocol ) : <EOL> Capability . __init__ ( self , protocol ) <EOL> protocol . register_operation ( "<STR_LIT>" , self . unadvertise_service ) <EOL> def unadvertise_service ( self , message ) : <EOL> service_name = message [ "<STR_LIT>" ] <EOL> if service_name in self . protocol . external_service_list . keys ( ) : <EOL> self . protocol . external_service_list [ service_name ] . service_handle . shutdown ( "<STR_LIT>" ) <EOL> del self . protocol . external_service_list [ service_name ] <EOL> self . protocol . log ( "<STR_LIT:info>" , "<STR_LIT>" % service_name ) <EOL> else : <EOL> self . protocol . log ( "<STR_LIT:error>" , "<STR_LIT>" % service_name ) </s>
