lib.Result.strip: Rename to .strip_output #18
1 changed files with 8 additions and 8 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue