From b04c8d200a70f5df4996b1591f5f74911bdf544e Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 13 Jun 2026 07:56:47 +0200 Subject: [PATCH] lib.Result.strip: Rename to .strip_output The .strip property of class Result defaults to True, and its name isn't very clear. Rename it to .strip_output, and default it to False to avoid surprising contents for unsuspecting callers. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/Result.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/python/jw/pkg/lib/Result.py b/src/python/jw/pkg/lib/Result.py index aea6223b..564c1f70 100644 --- a/src/python/jw/pkg/lib/Result.py +++ b/src/python/jw/pkg/lib/Result.py @@ -8,7 +8,7 @@ class Result: stderr: bytes | None = None, status: int | None = None, # Command has not yet exited encoding: str = 'UTF-8', - strip: bool = True, + strip_output: bool = False, cmd: list[str] | None = None, wd: str | None = None, ) -> None: @@ -16,7 +16,7 @@ class Result: self.__stderr = stderr self.__status = status self.__encoding = encoding - self.__strip = strip + self.__strip_output = strip_output self.__cmd = cmd self.__wd = wd @@ -24,7 +24,7 @@ class Result: if stdxxx is None: return None ret = stdxxx.decode(self.encoding) - if self.strip: + if self.strip_output: return ret.strip() return ret @@ -99,12 +99,12 @@ class Result: self.__encoding = value @property - def strip(self) -> bool: - return self.__strip + def strip_output(self) -> bool: + return self.__strip_output - @strip.setter - def strip(self, value: bool) -> None: - self.__strip = value + @strip_output.setter + def strip_output(self, value: bool) -> None: + self.__strip_output = value @property def cmd(self) -> list[str] | None: -- 2.54.0