def getFrames(self, **options): """Returns the list of up to 1000 frames from within the layer. @rtype: list<Frame> @return: Sequence of Frame obejcts""" criteria = opencue.search.FrameSearch.criteriaFromOptions(**options) response = self.stub.GetFrames(job_pb2.LayerGetFramesRequest(layer=self.data, s=criteria), timeout=Cuebot.Timeout) return [frame.Frame(frame) for frame in response.frames]
def getFrames(self, **options): """Returns a list of up to 1000 frames from within the layer. :type options: dict :param options: FrameSearch options :rtype: list<opencue.wrappers.frame.Frame> :return: sequence of matching frames """ criteria = opencue.search.FrameSearch.criteriaFromOptions(**options) response = self.stub.GetFrames(job_pb2.LayerGetFramesRequest( layer=self.data, s=criteria), timeout=Cuebot.Timeout) return [ opencue.wrappers.frame.Frame(frameData) for frameData in response.frames.frames ]
def testGetFrames(self, getStubMock): stubMock = mock.Mock() stubMock.GetFrames.return_value = job_pb2.LayerGetFramesResponse( frames=job_pb2.FrameSeq( frames=[job_pb2.Frame(layer_name=TEST_LAYER_NAME)])) getStubMock.return_value = stubMock layer = opencue.wrappers.layer.Layer( job_pb2.Layer(name=TEST_LAYER_NAME)) frames = layer.getFrames() stubMock.GetFrames.assert_called_with(job_pb2.LayerGetFramesRequest( layer=layer.data, s=opencue.search.FrameSearch.criteriaFromOptions()), timeout=mock.ANY) self.assertEqual(len(frames), 1) self.assertEqual(frames[0].data.layer_name, TEST_LAYER_NAME)