From 32bd33dfd4dac7651a59963dba2bc1c244ed8a73 Mon Sep 17 00:00:00 2001 From: gobbo_a Date: Fri, 26 Aug 2022 11:22:36 +0200 Subject: [PATCH] Script execution --- script/local.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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