mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 03:19:47 +03:00
Revert "pmb: Make RunOutputTypeDefault and RunOutputTypePopen enums"
Revert the patch, as it breaks "pmbootstrap chroot".
This reverts commit 7d2f055bcb
.
This commit is contained in:
parent
ae0d162d31
commit
3ea5a3433b
20 changed files with 84 additions and 167 deletions
51
pmb/types.py
51
pmb/types.py
|
@ -58,55 +58,8 @@ class CrossCompile(enum.Enum):
|
|||
return Chroot.native()
|
||||
|
||||
|
||||
class RunOutputTypeDefault(enum.Enum):
|
||||
LOG = enum.auto()
|
||||
STDOUT = enum.auto()
|
||||
INTERACTIVE = enum.auto()
|
||||
TUI = enum.auto()
|
||||
NULL = enum.auto()
|
||||
|
||||
def is_to_stdout(self) -> bool:
|
||||
match self:
|
||||
case self.STDOUT | self.INTERACTIVE:
|
||||
return True
|
||||
case self.LOG | self.TUI | self.NULL:
|
||||
return False
|
||||
case _:
|
||||
raise AssertionError
|
||||
|
||||
def has_timeout(self) -> bool:
|
||||
match self:
|
||||
case self.LOG | self.STDOUT:
|
||||
return True
|
||||
case self.INTERACTIVE | self.TUI | self.NULL:
|
||||
return False
|
||||
case _:
|
||||
raise AssertionError
|
||||
|
||||
def has_pass_stdin(self) -> bool:
|
||||
match self:
|
||||
case self.INTERACTIVE | self.TUI:
|
||||
return True
|
||||
case self.LOG | self.STDOUT | self.NULL:
|
||||
return False
|
||||
case _:
|
||||
raise AssertionError
|
||||
|
||||
|
||||
class RunOutputTypePopen(enum.Enum):
|
||||
BACKGROUND = enum.auto()
|
||||
PIPE = enum.auto()
|
||||
|
||||
def is_to_stdout(self) -> bool:
|
||||
return False
|
||||
|
||||
def has_timeout(self) -> bool:
|
||||
return False
|
||||
|
||||
def has_pass_stdin(self) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
RunOutputTypeDefault = Literal["log", "stdout", "interactive", "tui", "null"]
|
||||
RunOutputTypePopen = Literal["background", "pipe"]
|
||||
RunOutputType = RunOutputTypeDefault | RunOutputTypePopen
|
||||
RunReturnType = str | int | subprocess.Popen
|
||||
PathString = Path | str
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue