mirror of
https://github.com/Derisis13/barusu.git
synced 2025-12-06 19:42:48 +01:00
Changed subprocess.call-s to subbprocess.run-s
Additional status information in restore mode
This commit is contained in:
13
main.py
13
main.py
@@ -1,8 +1,8 @@
|
|||||||
|
import datetime
|
||||||
|
import getopt
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import datetime
|
|
||||||
import sys
|
import sys
|
||||||
import getopt
|
|
||||||
|
|
||||||
|
|
||||||
def run_daily():
|
def run_daily():
|
||||||
@@ -47,9 +47,10 @@ def restore():
|
|||||||
packagelist.close()
|
packagelist.close()
|
||||||
exit(2)
|
exit(2)
|
||||||
else:
|
else:
|
||||||
subprocess.call(["dpkg", "--set-selections"], stdin=packagelist)
|
subprocess.run(["dpkg", "--set-selections"], stdin=packagelist)
|
||||||
subprocess.call(["apt-get", "dselect-upgrade"])
|
subprocess.run(["apt-get", "dselect-upgrade"])
|
||||||
packagelist.close()
|
packagelist.close()
|
||||||
|
print("Restoration of packages complete")
|
||||||
else:
|
else:
|
||||||
print("You're not root! You can't restore packages unless you are root!")
|
print("You're not root! You can't restore packages unless you are root!")
|
||||||
try:
|
try:
|
||||||
@@ -59,8 +60,10 @@ def restore():
|
|||||||
"correct order of arguments: first -d/--backup-dir then -r/--restore!")
|
"correct order of arguments: first -d/--backup-dir then -r/--restore!")
|
||||||
config.close()
|
config.close()
|
||||||
else:
|
else:
|
||||||
subprocess.call(['dconf', 'load'], stdin=config)
|
subprocess.run(['dconf', 'load'], stdin=config)
|
||||||
config.close()
|
config.close()
|
||||||
|
print("Restoration of settings is complete")
|
||||||
|
print("Exitting...")
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user