Skip to content

Commit f983106

Browse files
committed
Add stream option to issue_command
1 parent 4c4b204 commit f983106

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

yamcs-client/src/yamcs/tmtc/client.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class CommandConnection(WebSocketSubscriptionFuture):
393393
Only commands issued from this object are monitored.
394394
"""
395395

396-
def __init__(self, manager, tmtc_client):
396+
def __init__(self, manager, tmtc_client: "ProcessorClient"):
397397
super(CommandConnection, self).__init__(manager)
398398
self._cmdhist_cache = {}
399399
self._command_cache = {}
@@ -403,9 +403,11 @@ def issue(
403403
self,
404404
command: str,
405405
args: Optional[Mapping[str, Any]] = None,
406+
*,
406407
dry_run: bool = False,
407408
comment: Optional[str] = None,
408409
verification: Optional[VerificationConfig] = None,
410+
stream: Optional[str] = None,
409411
extra: Optional[Mapping[str, Any]] = None,
410412
sequence_number: Optional[int] = None,
411413
) -> MonitoredCommand:
@@ -425,6 +427,10 @@ def issue(
425427
Comment attached to the command.
426428
:param verification:
427429
Overrides to the default verification handling of this command.
430+
:param stream:
431+
Override the stream on which the command should be sent out.
432+
433+
.. versionadded:: 1.9.6
428434
:param extra:
429435
Extra command options for interpretation by non-core extensions
430436
(custom preprocessor, datalinks, command listeners). Note that
@@ -443,12 +449,13 @@ def issue(
443449
command and updated according to command history updates.
444450
"""
445451
issued_command = self._tmtc_client.issue_command(
446-
command,
447-
args,
448-
dry_run,
449-
comment,
450-
verification,
451-
extra,
452+
command=command,
453+
args=args,
454+
dry_run=dry_run,
455+
comment=comment,
456+
verification=verification,
457+
stream=stream,
458+
extra=extra,
452459
sequence_number=sequence_number,
453460
)
454461
cmd = MonitoredCommand(issued_command._proto)
@@ -688,9 +695,11 @@ def issue_command(
688695
self,
689696
command: str,
690697
args: Optional[Mapping[str, Any]] = None,
698+
*,
691699
dry_run: bool = False,
692700
comment: Optional[str] = None,
693701
verification: Optional[VerificationConfig] = None,
702+
stream: Optional[str] = None,
694703
extra: Optional[Mapping[str, Any]] = None,
695704
sequence_number: Optional[int] = None,
696705
) -> IssuedCommand:
@@ -710,6 +719,10 @@ def issue_command(
710719
Comment attached to the command.
711720
:param verification:
712721
Overrides to the default verification handling of this command.
722+
:param stream:
723+
Override the stream on which the command should be sent out.
724+
725+
.. versionadded:: 1.9.6
713726
:param extra:
714727
Extra command options for interpretation by non-core
715728
extensions (custom preprocessor, datalinks, command listeners).
@@ -737,6 +750,8 @@ def issue_command(
737750
if args:
738751
for key in args:
739752
req.args[key] = to_argument_value(args[key], force_string=True)
753+
if stream:
754+
req.stream = stream
740755

741756
if verification:
742757
if verification._disable_all:

0 commit comments

Comments
 (0)