Skip to content

Commit

Permalink
Improve "src/aiko_services/examples/pipeline/elements.py:PE_Inspect()",
Browse files Browse the repository at this point in the history
if parameter "inspect" isn't assigned, then inspect all input / output
Stream inputs / outputs.
  • Loading branch information
geekscape committed Oct 8, 2024
1 parent f9f837c commit 2a0a2ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/aiko_services/examples/pipeline/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ def process_frame(self, stream) -> Tuple[aiko.StreamEvent, dict]:
enable, _ = self.get_parameter("enable", True)
if enable:
names, found = self.get_parameter("inspect")
if not found:
return aiko.StreamEvent.ERROR, \
{"diagnostic": "'inspect' parameter not found"}
name, names = parse(names)
names.insert(0, name)
if "*" in names:
if found:
name, names = parse(names)
names.insert(0, name)
if "*" in names:
names = frame.swag.keys()
else:
names = frame.swag.keys()

target, _ = self.get_parameter("target", "log")
Expand All @@ -110,7 +110,7 @@ def process_frame(self, stream) -> Tuple[aiko.StreamEvent, dict]:

return aiko.StreamEvent.OKAY, _all_outputs(self, stream)

def start_stream(self, stream, stream_id):
def stop_stream(self, stream, stream_id):
inspect_file = stream.variables.get("inspect_file", None)
if inspect_file:
inspect_file.close()
Expand Down
2 changes: 1 addition & 1 deletion src/aiko_services/examples/pipeline/pipeline_local.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"parameters": {
"enable": true, "#": "true or false",
"inspect": "(*)", "#": "inputs / outputs names",
"target": "file:z_inspect.txt", "#": "file, log or print"},
"target": "file:z_inspect.txt", "#": "file:, log or print"},
"input": [],
"output": [],
"deploy": {
Expand Down

0 comments on commit 2a0a2ea

Please sign in to comment.