当前位置: 首页>>代码示例>>Python>>正文


Python ServerProxy.unregisterPublisher方法代码示例

本文整理汇总了Python中xmlrpc.client.ServerProxy.unregisterPublisher方法的典型用法代码示例。如果您正苦于以下问题:Python ServerProxy.unregisterPublisher方法的具体用法?Python ServerProxy.unregisterPublisher怎么用?Python ServerProxy.unregisterPublisher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xmlrpc.client.ServerProxy的用法示例。


在下文中一共展示了ServerProxy.unregisterPublisher方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Master

# 需要导入模块: from xmlrpc.client import ServerProxy [as 别名]
# 或者: from xmlrpc.client.ServerProxy import unregisterPublisher [as 别名]

#.........这里部分代码省略.........
        Unregister the caller as a publisher of the topic.
        @param topic: Fully-qualified name of topic to unregister.
        @type  topic: str
        @param caller_api: API URI of service to unregister. Unregistration will only occur if current
        @type  caller_api: str
           registration matches.    
        @return: (code, statusMessage, numUnsubscribed). 
          If numUnsubscribed is zero it means that the caller was not registered as a subscriber.
          The call still succeeds as the intended final state is reached.
        @rtype: (int, str, int)
        @raise rosgraph.masterapi.Error: if Master returns ERROR.
        @raise rosgraph.masterapi.Failure: if Master returns FAILURE.
        """
        return self._succeed(self.handle.unregisterSubscriber(self.caller_id, topic, caller_api))
    
    def registerPublisher(self, topic, topic_type, caller_api):
        """
        Register the caller as a publisher the topic.
        @param topic: Fully-qualified name of topic to register.
        @type  topic: str
        @param topic_type: Datatype for topic. Must be a
        package-resource name, i.e. the .msg name.
        @type  topic_type: str
        @param caller_api str: ROS caller XML-RPC API URI
        @type  caller_api: str
        @return: subscriberApis.
        List of current subscribers of topic in the form of XMLRPC URIs.
        @rtype: [str]
        @raise rosgraph.masterapi.Error: if Master returns ERROR.
        @raise rosgraph.masterapi.Failure: if Master returns FAILURE.
        """
        return self._succeed(self.handle.registerPublisher(self.caller_id, topic, topic_type, caller_api))
    
    def unregisterPublisher(self, topic, caller_api):
        """
        Unregister the caller as a publisher of the topic.
        @param topic: Fully-qualified name of topic to unregister.
        @type  topic: str
        @param caller_api str: API URI of service to
           unregister. Unregistration will only occur if current
           registration matches.
        @type  caller_api: str
        @return: numUnregistered. 
           If numUnregistered is zero it means that the caller was not registered as a publisher.
           The call still succeeds as the intended final state is reached.
        @rtype: int
        @raise rosgraph.masterapi.Error: if Master returns ERROR.
        @raise rosgraph.masterapi.Failure: if Master returns FAILURE.
        """            
        return self._succeed(self.handle.unregisterPublisher(self.caller_id, topic, caller_api))        

    def lookupNode(self, node_name):
        """
        Get the XML-RPC URI of the node with the associated
        name/caller_id.  This API is for looking information about
        publishers and subscribers. Use lookupService instead to lookup
        ROS-RPC URIs.
        @param node: name of node to lookup
        @type  node: str
        @return: URI
        @rtype: str
        @raise rosgraph.masterapi.Error: if Master returns ERROR.
        @raise rosgraph.masterapi.Failure: if Master returns FAILURE.
        """
        return self._succeed(self.handle.lookupNode(self.caller_id, node_name))        
        
开发者ID:Aand1,项目名称:ROSCH,代码行数:69,代码来源:masterapi.py


注:本文中的xmlrpc.client.ServerProxy.unregisterPublisher方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。