improvement: replacing subprocess commands to detected installed CLIs by Python faster native calls (shutil.which)

This commit is contained in:
Vinicius Moreira
2021-06-15 17:09:49 -03:00
parent dfdc209374
commit 9a8772da8f
14 changed files with 36 additions and 37 deletions

View File

@@ -1,8 +1,10 @@
from bauh.commons.system import run_cmd, SimpleProcess
import shutil
from bauh.commons.system import SimpleProcess
def is_available() -> bool:
return bool(run_cmd('which timeshift', print_error=False))
return bool(shutil.which('timeshift'))
def delete_all_snapshots(root_password: str) -> SimpleProcess: