Files
bearhub/fpakman/core/system.py
Vinícius Moreira 8a95d508c8 0.1.0 (#1)
- Supporting flatpak 1.X, 1.2X and 1.4.X
- Tray icon
- System notifications when new updates are available
- Applications management window
2019-06-14 16:50:29 -03:00

7 lines
272 B
Python

import subprocess
def run_cmd(cmd: str, expected_code: int = 0, ignore_return_code: bool = False) -> str:
res = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE)
return res.stdout.decode() if ignore_return_code or res.returncode == expected_code else None