From 6775ea0d7f8daae0090a26e8c9b496fb852428fe Mon Sep 17 00:00:00 2001 From: "Andres Mauricio (ElJavatar)" Date: Thu, 20 Sep 2018 21:47:38 -0500 Subject: [PATCH] ajustes --- Utils.py | 4 ++++ Vista.py | 7 ++++--- datos.json | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Utils.py b/Utils.py index eaab82a..ac11520 100644 --- a/Utils.py +++ b/Utils.py @@ -33,6 +33,10 @@ def cargarDatosAndReturnR(ruta): listDFToValidate.append(df) r.dataT = datos["R"]["T"] + for i in range(0, len(r.dataT)): + r.dataT[i] = r.dataT[i].strip() + r.dataT.sort() + r.dependencias = listDF r.dfToValidate = listDFToValidate diff --git a/Vista.py b/Vista.py index 7175b25..52f6860 100644 --- a/Vista.py +++ b/Vista.py @@ -48,9 +48,9 @@ def fillData(): def loadFile(): try: root.filename = filedialog.askopenfilename(initialdir = "",title = "Select file",filetypes = (("JSON files","*.json"),("all files","*.*"))) + #root.filename = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("JSON files","*.json"),("all files","*.*"))) # Disco C if not messagebox.askyesno(title = "Mensaje de Confirmación", message = "Al cargar este archivo, se sobreescribirán las\nvariables de entrada del conjunto R(T, L)\n¿Está seguro de continuar?"): return - #root.filename = filedialog.askopenfilename(initialdir = "",title = "Select file",filetypes = (("JSON files","*.json"),("all files","*.*"))) # Disco C pathFile.set(root.filename) dataLoad = utils.cargarDatosAndReturnR(root.filename); r.dataT = dataLoad.dataT.copy() @@ -79,6 +79,7 @@ def cleanDependencias(): listDF.clear() for i in tableDependencias.get_children(): tableDependencias.delete(i) + r.dfToValidate = [] def calcularRecubrimientoMinimo(): @@ -101,7 +102,7 @@ def calcularRecubrimientoMinimo(): def initForm(): root.title("Recubrimiento Mínimo") - root.resizable(True, True) + root.resizable(False, False) #root.iconbitmap("ruta.ico") @@ -157,7 +158,7 @@ def initForm(): tableDependencias.configure(yscrollcommand = scrollbar_vertical.set) - buttonCleanDF = Button(frameDF, text = "Limpir Dependencias", font = textFont, command = cleanDependencias) + buttonCleanDF = Button(frameDF, text = "Limpiar Dependencias", font = textFont, command = cleanDependencias) buttonCleanDF.grid(row = 1, column = 0, padx = 5, pady = 5) diff --git a/datos.json b/datos.json index 7c96342..c79509b 100644 --- a/datos.json +++ b/datos.json @@ -1,6 +1,6 @@ { "R":{ - "T":["a","b","c","d","e","f","g"], + "T":["a","b","c","d","e","g","f"], "L":[ {"impX":"a", "impY":"b"}, {"impX":"a", "impY":"d"},