Add programs list, implement subprocess to start apt, error handling

This commit is contained in:
Marcel Schwarz 2019-12-30 01:00:47 +01:00
parent 33737fec66
commit f5cd3c6234
2 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,19 @@
import json
import subprocess
from AbstractModule import AbstractModule
class CmdToolsModule(AbstractModule):
def run(self):
print("Commandline Tools")
print("Try to install basic Command-line tools")
with open("modules/command-line tools/programs.json") as config_file:
programms_list = json.load(config_file)
out = subprocess.run(["apt", "install"] + programms_list, shell=True, capture_output=True)
if len(out.stderr) > 0:
print(out.stderr.decode())
print("Install might be not complete, please check output above.")
else:
print("Installed successful.")

View File

@ -0,0 +1,8 @@
[
"bleachbit",
"nano",
"xrdp",
"htop",
"bash-completion",
"dialog"
]