From 0e8ed6ff584f3cccc486adb25be75940a0c142f1 Mon Sep 17 00:00:00 2001 From: David Cruciani Date: Tue, 1 Jun 2021 11:14:00 +0200 Subject: [PATCH] blockProg --- bin/Generator.py | 15 +++++++++++++-- etc/allVariables.py | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/Generator.py b/bin/Generator.py index c992a91..9315a7e 100644 --- a/bin/Generator.py +++ b/bin/Generator.py @@ -22,9 +22,20 @@ def runningVms(): def readFile(): f = open(str(pathProg) + "/tmp","r") + f1 = open(allVariables.blockProg, "r") + l = f.readline().rstrip() + l1 = f1.readlines() + f.close() - return l + f1.close() + + listTmp = [l.split(":")[0],l.split(":")[1]] + + for line in l1: + if line.split(":")[0] == listTmp[1]: + return [listTmp[0], line.split(":")[1]] + return listTmp def create_rule(ext, hexa, product_version, l_app): app = "" @@ -104,7 +115,7 @@ def runAuto(s): partage = allVariables.pathToConvert status = readFile() - convert_file = "%s%s_%s.img" %(partage, status.split(":")[1], status.split(":")[0]) + convert_file = "%s%s_%s.img" %(partage, status[1], status[0]) print("## Convertion ##") ############### Mettre plutot le nom de l'exe pour la machine linux pour faire un grep -i direct en fonction du nom diff --git a/etc/allVariables.py b/etc/allVariables.py index 1f91b37..9892848 100644 --- a/etc/allVariables.py +++ b/etc/allVariables.py @@ -1,6 +1,9 @@ #Path to the list that contains software to install: "nameOfPackage":"nameOfExe" applist = "tests/listapp.txt" +#Path to list of special software +blockProg = "" + #Settings for server flask host = "0.0.0.0" port = "5000"