-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from rtCamp/develop
Patch v0.13.4
- Loading branch information
Showing
7 changed files
with
68 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from dataclasses import dataclass | ||
from typing import List | ||
|
||
|
||
@dataclass | ||
class SubprocessOutput: | ||
stdout: List[str] | ||
stderr: List[str] | ||
combined: List[str] | ||
exit_code: int | ||
|
||
@classmethod | ||
def from_output(cls, output): | ||
stdout = [] | ||
stderr = [] | ||
combined = [] | ||
exit_code = 0 | ||
|
||
for source, line in output: | ||
line = line.decode() | ||
if source == 'exit_code': | ||
exit_code = int(line) | ||
else: | ||
combined.append(line) | ||
if source == 'stdout': | ||
stdout.append(line) | ||
if source == 'stderr': | ||
stderr.append(line) | ||
|
||
data = {'stdout': stdout, 'stderr': stderr, 'combined': combined, 'exit_code': exit_code} | ||
return cls(**data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters