def _run(self, robot, options): args = (camera_pb2.Camera(name=options.camera_name), logging_pb2.Logpoint.STILLIMAGE) logpoint = robot.ensure_client( MediaLogClient.default_service_name).store(*args) return logpoint
def _mock_stream(name='good', x_offset=0, y_offset=0, width=2, height=1): stream = compositor_pb2.GetVisibleCamerasResponse.Stream() stream.window.CopyFrom( compositor_pb2.GetVisibleCamerasResponse.Stream.Window( xoffset=x_offset, yoffset=y_offset, width=width, height=height)) stream.camera.CopyFrom(camera_pb2.Camera(name=name)) return stream
def test_store(): client, service, server = _setup() camera = camera_pb2.Camera() camera.name = 'pano' camera_tag = '{}-tag'.format(camera.name) lp = client.store(camera, logging_pb2.Logpoint.STILLIMAGE, camera_tag) assert lp.name == camera.name assert lp.type == logging_pb2.Logpoint.STILLIMAGE assert lp.tag == camera_tag
def _run(self, robot, options): client = robot.ensure_client(MediaLogClient.default_service_name) args = (camera_pb2.Camera(name=options.camera_name), logging_pb2.Logpoint.STILLIMAGE) lp = client.store(*args) while lp.status != logging_pb2.Logpoint.COMPLETE: lp = client.get_status(lp) lp = MediaLogRetrieveCommand.save_logpoint_as_image(robot, lp, options, dst_filename=options.dst) return lp