replace subprocess calls with native calls
This commit is contained in:
parent
82e4e9e10f
commit
9c2507ed13
1 changed files with 8 additions and 7 deletions
15
debian/prerm
vendored
15
debian/prerm
vendored
|
|
@ -13,6 +13,7 @@ def col(id):
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
from shutil import rmtree
|
||||||
|
|
||||||
# Only run when we actually want to remove
|
# Only run when we actually want to remove
|
||||||
if "remove" not in sys.argv and "purge" not in sys.argv:
|
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
|
# Remove files and symlinks
|
||||||
try:
|
try:
|
||||||
subprocess.call(["rm /usr/local/bin/howdy"], shell=True)
|
os.unlink('/usr/local/bin/howdy')
|
||||||
except e:
|
except Exception:
|
||||||
print("Can't remove executable")
|
print("Can't remove executable")
|
||||||
try:
|
try:
|
||||||
subprocess.call(["rm /usr/share/bash-completion/completions/howdy"], shell=True)
|
os.unlink('/usr/share/bash-completion/completions/howdy')
|
||||||
except e:
|
except Exception:
|
||||||
print("Can't remove autocompletion script")
|
print("Can't remove autocompletion script")
|
||||||
try:
|
try:
|
||||||
subprocess.call(["rm -rf /lib/security/howdy"], shell=True)
|
rmtree('/lib/security/howdy')
|
||||||
except e:
|
except Exception:
|
||||||
# This error is normal
|
# This error is normal
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Remove face_recognition and dlib
|
# 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 a tearbending message
|
||||||
print(col(2) + """
|
print(col(2) + """
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue