0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-19 09:51:19 +02:00

replace subprocess calls with native calls

This commit is contained in:
dmig 2018-12-09 13:25:02 +07:00
parent 82e4e9e10f
commit 9c2507ed13
No known key found for this signature in database
GPG key ID: A4A245B3AD37C4FC

15
debian/prerm vendored
View file

@ -13,6 +13,7 @@ def col(id):
import subprocess
import sys
import os
from shutil import rmtree
# Only run when we actually want to remove
if "remove" not in sys.argv and "purge" not in sys.argv:
@ -24,21 +25,21 @@ if not os.path.exists("/lib/security/howdy/cli"):
# Remove files and symlinks
try:
subprocess.call(["rm /usr/local/bin/howdy"], shell=True)
except e:
os.unlink('/usr/local/bin/howdy')
except Exception:
print("Can't remove executable")
try:
subprocess.call(["rm /usr/share/bash-completion/completions/howdy"], shell=True)
except e:
os.unlink('/usr/share/bash-completion/completions/howdy')
except Exception:
print("Can't remove autocompletion script")
try:
subprocess.call(["rm -rf /lib/security/howdy"], shell=True)
except e:
rmtree('/lib/security/howdy')
except Exception:
# This error is normal
pass
# Remove face_recognition and dlib
subprocess.call(["pip3 uninstall face_recognition face_recognition_models dlib -y --no-cache-dir"], shell=True)
subprocess.call(['pip3', 'uninstall', 'dlib', '-y', '--no-cache-dir'])
# Print a tearbending message
print(col(2) + """