Skip to content

Conversation

@douglas-raillard-arm
Copy link
Collaborator

Ease blocking interaction with a BackgroundCommand object, in the style of Popen.communicate()

Tested on paramiko and local target, but not android.

Add a "cmd" attribute for better exception messages.
Copy link
Collaborator

@setrofim setrofim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be merged without the implementation of communicate() for all existing derivations of ConnectionBase (i.e. LocalConnection and AdbConnection).

@douglas-raillard-arm
Copy link
Collaborator Author

@setrofim I'm not sure to understand, communicate() is a new method of BackgroundCommand, and is implemented by all its subclasses. ConnectionBase is left untouched in the operation.

Copy link
Collaborator

@setrofim setrofim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh. My bad. I was fooled by the collapsed code and read it as being added to ConnectionBase. My apologies.

@douglas-raillard-arm
Copy link
Collaborator Author

No worries, GitHub is indeed not so smart in its folding. It only shows the previous "def ..." line in the hunk header, instead of doing something based on indentation

Add a communicate() method in the style of Popen.communicate().

Unlike Popen.communicate, it will raise a CalledProcessError if the
command exit with non-zero code.
@douglas-raillard-arm douglas-raillard-arm mentioned this pull request Aug 19, 2021
@marcbonnici marcbonnici merged commit 8b92f55 into ARM-software:master Aug 19, 2021
@douglas-raillard-arm
Copy link
Collaborator Author

douglas-raillard-arm commented Aug 31, 2021

EDIT: the comment was on the wrong PR and is irrelevant here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants