def getCommandCodes(self, aplicationCode): aplicationFindCommandByCode = ApplicationFindCommandByCode() result = aplicationFindCommandByCode.find(aplicationCode) self.commandDictionary = {} for command in result: self.commandDictionary[command[0]] = command[1]
def codeApplicationManagement(self): applicationFindAllDao = ApplicationFindAllDao() applications = applicationFindAllDao.find() index = 1 call(["clear"]) print "Escribe el numero de la opcion que desea modificar" for application in applications: print str(index) + ") " + application[0] + " - " + application[1] index += 1 index = int(raw_input()) if self.validateLength(len(applications), index) == False: return index = index - 1 self.applicationIndex = index application = applications[index] applicationFindCommandByCodeDao = ApplicationFindCommandByCode() codes = applicationFindCommandByCodeDao.find(application[0]) call(["clear"]) print "Que codigo desea modificar" index = 1 for code in codes: print str(index) + ") " + code[0] + " - " + code[1] index += 1 index = int(raw_input()) if self.validateLength(len(codes), index) == False: return index = index -1 self.codeIndex = index call(["clear"]) print "Modificacion de parametros para la aplicacion: " print applications[self.applicationIndex][0] + " - " + applications[self.applicationIndex][1] print "--------------------------------------------" print "Se muestra el contenido del comando que desea cambiar: " print codes[self.codeIndex][0] + " - " + codes[self.codeIndex][1] newCode = raw_input("Escriba el nuevo codigo: ") newValue = raw_input("Escriba el nuevo valor: ") if "" == newCode: call(["clear"]) print "El valor del nuevo codigo no puede estar vacio" return if "" == newValue: call(["clear"]) print "El valor del nuevo valor no puede estar vacio" return applicationCodeUpdateDao = ApplicationCodeUpdateDao() applicationCodeUpdateDao.update(newCode, newValue, codes[self.codeIndex][0])
def getCommands(self): self.removeElementsByCommandFrame() if self.commandTitle == None: self.commandTitle = Label(self.app, text="Comandos:") commandTitleY = self.myY + 50 self.commandTitle.place(x=10, y=commandTitleY) self.clearEntry() applicationFindCommandByCode = ApplicationFindCommandByCode() print "opcion seleccionada: " + str(self.var.get()) codes = applicationFindCommandByCode.find(self.var.get()) print codes myYCommand=self.myY + 100 if self.labelCommandCode == None: self.labelCommandCode = Label(self.app, text="comando") self.labelCommandCode.place(x=50, y=myYCommand) self.labelValueCode = Label(self.app, text="valor") self.labelValueCode.place(x=150, y=myYCommand) self.labelDeleteCode = Label(self.app, text="eliminar") self.labelDeleteCode.place(x=320, y=myYCommand) myYCommand=myYCommand + 30 myYCount=30 entryMap = {} self.listEntry = [] self.listCheck = [] for code in codes: checkVar = IntVar() first = Entry(self.app) first.insert(0, code[0]) first.place(x=50, y=myYCommand) self.listEntry.append(first) second = Entry(self.app) second.insert(0, code[1]) second.place(x=150, y=myYCommand) self.listEntry.append(second) chk = Checkbutton(self.app, variable=checkVar) chk.place(x=320, y=myYCommand) self.varChecks.append(checkVar) self.listCheck.append(chk) myYCommand += myYCount self.addElementsByCommandFrame(myYCommand) print self.listEntry
def addCommand(self): listEntry = self.listEntry self.clearEntry self.removeElementsByCommandFrame() applicationFindCommandByCode = ApplicationFindCommandByCode() codes = applicationFindCommandByCode.find(self.var.get()) myYCount=30 myYCommand=self.myY + 100 entryMap = {} self.listEntry = [] for code in codes: checkVar = IntVar() first = Entry(self.app) first.insert(0, code[0]) first.place(x=50, y=myYCommand) self.listEntry.append(first) second = Entry(self.app) second.insert(0, code[1]) second.place(x=150, y=myYCommand) self.listEntry.append(second) chk = Checkbutton(self.app, variable=checkVar) chk.place(x=320, y=myYCommand) self.varChecks.append(checkVar) self.listCheck.append(chk) myYCommand += myYCount addCodeExt = Entry(self.app) addCodeExt.place(x=50, y=myYCommand) self.listEntry.append(addCodeExt) addValueExt = Entry(self.app) addValueExt.place(x=150, y=myYCommand) self.listEntry.append(addValueExt) myYCommand += myYCount self.addElementsByCommandFrame(myYCommand)