Retrieving app information and history

This commit is contained in:
Vinícius Moreira
2019-06-26 15:52:26 -03:00
committed by GitHub
parent f9f47d1429
commit c2e59ba757
12 changed files with 694 additions and 69 deletions

View File

@@ -3,9 +3,9 @@ from typing import List
def run_cmd(cmd: str, expected_code: int = 0, ignore_return_code: bool = False) -> str:
res = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE)
res = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE, env={'LANG': 'en'})
return res.stdout.decode() if ignore_return_code or res.returncode == expected_code else None
def stream_cmd(cmd: List[str]):
return subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout
return subprocess.Popen(cmd, stdout=subprocess.PIPE, env={'LANG': 'en'}).stdout