[arch] fix -> 'rebuild-detector' integration not working when launched from KDE menu or PyCharm

This commit is contained in:
Vinicius Moreira
2021-01-15 17:56:02 -03:00
parent 765bdff851
commit 465c90a7b6
6 changed files with 8 additions and 11 deletions

View File

@@ -323,7 +323,7 @@ def check_enabled_services(*names: str) -> Dict[str, bool]:
return {s: status[i].strip().lower() == 'enabled' for i, s in enumerate(names) if s}
def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bool = True, custom_env: Optional[dict] = None) -> Tuple[int, Optional[str]]:
def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bool = True, custom_env: Optional[dict] = None, stdin: bool = True) -> Tuple[int, Optional[str]]:
params = {
'args': cmd.split(' ') if not shell else [cmd],
'stdout': subprocess.PIPE if output else subprocess.DEVNULL,
@@ -331,6 +331,9 @@ def execute(cmd: str, shell: bool = False, cwd: Optional[str] = None, output: bo
'shell': shell
}
if not stdin:
params['stdin'] = subprocess.DEVNULL
if cwd is not None:
params['cwd'] = cwd