Skip to content

Commit

Permalink
Now preserving trailing whitespaces in stderr and stdout of subproces…
Browse files Browse the repository at this point in the history
…ses to keep any potential indentation for better readability. Also, fixed a lint warning in __main__.py.
  • Loading branch information
zapta committed Sep 4, 2024
1 parent f3924f7 commit 67ed2e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apio/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# --------------------------------------------

import string
import click
import re
import click

from apio import util

Expand Down Expand Up @@ -128,7 +128,8 @@ def cli(ctx):
# -- We later split the command lines into command groups.
index = help_lines.index("Commands:")
header_lines = help_lines[:index]
command_lines = help_lines[index + 1 :]
index += 1 # Skip the Commands: line.
command_lines = help_lines[index:]

# -- Select project commands:
project_help = select_commands_help(
Expand Down
3 changes: 2 additions & 1 deletion apio/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def run(self):
"""DOC: TODO"""

for line in iter(self._pipe_reader.readline, ""):
line = line.strip()
# We do preserve trailing whitespace and indentation.
line = line.rstrip()
self._buffer.append(line)
if self.outcallback:
self.outcallback(line)
Expand Down

0 comments on commit 67ed2e3

Please sign in to comment.