diff --git a/script/local.py b/script/local.py index 723e45d..9fef1bb 100644 --- a/script/local.py +++ b/script/local.py @@ -115,7 +115,7 @@ statistics =None current_pipeline = None def start_pipeline(name, parameters, port=DEFAULT_PIPELINE_PORT): - global stop_event, parameter_queue, statistics. current_pipeline, parameter_queue, statistics + global stop_event, parameter_queue, statistics, current_pipeline, parameter_queue, statistics if name is None: raise Exception("Pipeline name undefined") stop_pipeline(); @@ -146,7 +146,14 @@ def stop_pipeline(): parameter_queue = None statistics =None - - def get_pipeline(): - return current_pipeline \ No newline at end of file + return current_pipeline + +def get_pipeline_msg(): + if not get_pipeline(): + raise Exception("Pipeline not started") + with source(host="127.0.0.1", port=pipeline_port, mode=SUB, receive_timeout = 3000) as stream: + data = stream.receive() + if not data: + raise Exception("Received None message.") + return data.data \ No newline at end of file