예제 #1
0
파일: OlaClient.py 프로젝트: swgrainger/ola
    def SetUniverseName(self, universe, name, callback=None):
        """Set the name of a universe.

    Args:
      universe: the universe to set the name of
      name: the new name for the universe
      callback: The function to call once complete, takes one argument, a
        RequestStatus object.

    Returns:
      True if the request was sent, False otherwise.
    """
        if self._socket is None:
            return False

        controller = SimpleRpcController()
        request = Ola_pb2.UniverseNameRequest()
        request.universe = universe
        request.name = name
        done = lambda x, y: self._AckMessageComplete(callback, x, y)
        try:
            self._stub.SetUniverseName(controller, request, done)
        except socket.error:
            raise OLADNotRunningException()
        return True
예제 #2
0
    def SetUniverseName(self, universe, name, callback=None):
        """Set the name of a universe.

    Args:
      universe: the universe to set the name of
      name: the new name for the universe
      callback: The function to call once complete, takes one argument, a
        RequestStatus object.
    """
        controller = SimpleRpcController()
        request = Ola_pb2.UniverseNameRequest()
        request.universe = universe
        request.name = name
        done = lambda x, y: self._AckMessageComplete(callback, x, y)
        self._stub.SetUniverseName(controller, request, done)