linux-tools/modules/install/ToolsInstaller.py
Marcel Schwarz 6061a7d224 Change from dynamic to explicit module loading
dynamic loading was removed to have an overall better flow control,
Remove Abstract Module, 
clear out module __init__.py
2020-03-06 02:34:57 +01:00

24 lines
778 B
Python

import json
import subprocess
class ToolsInstaller:
def __init__(self):
with open("modules/install/programs.json") as config_file:
self.programs_json = json.load(config_file)
def basic_tools(self):
"""Install the most basic tools!"""
print("Try to install basic Command-line tools")
programs_list = " ".join(p for p in self.programs_json['basic-tools'])
subprocess.run("apt install" + programs_list, shell=True)
print("Script ran to completion.")
def hard_drive_tools(self):
"""Install tools to look up smart information from your hard-drives"""
programs_list = " ".join(p for p in self.programs_json['hard-drive'])
subprocess.run("apt install " + programs_list, shell=True)