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,
|
stderr: bytes | None = None,
|
||||||
status: int | None = None, # Command has not yet exited
|
status: int | None = None, # Command has not yet exited
|
||||||
encoding: str = 'UTF-8',
|
encoding: str = 'UTF-8',
|
||||||
strip: bool = True,
|
strip_output: bool = False,
|
||||||
cmd: list[str] | None = None,
|
cmd: list[str] | None = None,
|
||||||
wd: str | None = None,
|
wd: str | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
@ -16,7 +16,7 @@ class Result:
|
||||||
self.__stderr = stderr
|
self.__stderr = stderr
|
||||||
self.__status = status
|
self.__status = status
|
||||||
self.__encoding = encoding
|
self.__encoding = encoding
|
||||||
self.__strip = strip
|
self.__strip_output = strip_output
|
||||||
self.__cmd = cmd
|
self.__cmd = cmd
|
||||||
self.__wd = wd
|
self.__wd = wd
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ class Result:
|
||||||
if stdxxx is None:
|
if stdxxx is None:
|
||||||
return None
|
return None
|
||||||
ret = stdxxx.decode(self.encoding)
|
ret = stdxxx.decode(self.encoding)
|
||||||
if self.strip:
|
if self.strip_output:
|
||||||
return ret.strip()
|
return ret.strip()
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
@ -99,12 +99,12 @@ class Result:
|
||||||
self.__encoding = value
|
self.__encoding = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def strip(self) -> bool:
|
def strip_output(self) -> bool:
|
||||||
return self.__strip
|
return self.__strip_output
|
||||||
|
|
||||||
@strip.setter
|
@strip_output.setter
|
||||||
def strip(self, value: bool) -> None:
|
def strip_output(self, value: bool) -> None:
|
||||||
self.__strip = value
|
self.__strip_output = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cmd(self) -> list[str] | None:
|
def cmd(self) -> list[str] | None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue