diff --git a/scripts/linuxparty.py b/scripts/linuxparty.py index 5bd0090092ce3bf6b2b03de7a72ef9e6b6e15d50..423b9446069212b607ca49db2064468b44a26cf1 100755 --- a/scripts/linuxparty.py +++ b/scripts/linuxparty.py @@ -88,11 +88,10 @@ def installProcess(): window.ui.progressBar.show() window.ui.progressBar.setRange(0,0) pkglist = getPackagelistTree() - print(pkglist) - #installPackages() - window.ui.progressBar.setRange(0,1) - window.ui.progressBar.setValue(1) - makeDocu(pkglist) + installPackages(pkglist) + #window.ui.progressBar.setRange(0,1) + #window.ui.progressBar.setValue(1) + makeDoku(pkglist) showSuccBox() def showSuccBox(): @@ -128,25 +127,23 @@ def checkIfRoot(): else: pass -def installPackages(): - command=["echo", "apt-get", "install","--quiet", "-y", "--force-yes"] +def installPackages(strlist): + command=["echo", "apt-get", "install","--quiet", "-y", "--force-yes"," ".join(strlist)] #command=["apt-get", "install","--quiet", "-y", "--force-yes"] - subprocess.check_call(command+pkglist, shell=False) + #subprocess.call(command, shell=False) + stdout_installPackages = subprocess.check_output(command, shell=False) + print(stdout_installPackages) def mountStick(): command=[basepath+"infuse_offline_repo.sh"] - try: - subprocess.run(command, shell=False) - except: - showErrorBox("subprocess infuse_offlinerepo.sh failed.") + stdout_mountStick = subprocess.check_output(command, shell=False) + print(stdout_mountStick) -def makeDocu(): - command=["echo", "./makeDoku.sh", os.path.dirname(basepath), " ".join(pkglist)] +def makeDoku(stringlist): + command=["echo", "./makeDoku.sh", os.path.dirname(basepath), " ".join(stringlist)] #command=["./makeDoku.sh", os.path.dirname(basepath), " ".join(pkglist)] - try: - subprocess.run(command, shell=False) - except: - showErrorBox("Subprocess makeDocu.sh failed") + stdout_makeDoku = subprocess.check_output(command, shell=False) + print(stdout_makeDoku) def getPackagelist(): installList = [] @@ -217,7 +214,7 @@ if __name__ == '__main__': #mountStick() window = Main() window.setWindowTitle("Linux Install Party Software Installer") - with open('./offline_repo.json', 'r') as inputfile: + with open('../offline_repo.json', 'r') as inputfile: #with open('./test.json', 'r') as inputfile: data=json.loads(inputfile.read(), object_pairs_hook=OrderedDict) fillTreeView(data, window.ui.treeView)