def OnIniciarExportacionButton(self, event): self.btnGuardarReporte.Show(False) self.Update() NoGrupo = module2.status.OrgClave hashCode = module2.status.OrgHash nombreGrupo = module2.status.OrgNombre self.resultado.Clear() self.Update() if hashCode != module2.myHash(str(NoGrupo)): module2.MError(self, u"Para exportar debes registrar en Datos Generales la clave de la organizaci\xf3n y el c\xf3digo de verificaci\xf3n") else: self.status.Show() self.Update() moduleExp1.exportando=True res, archivo = PreparaEnvio(nombreGrupo,NoGrupo,hashCode) texto = "\n\n".join(res) self.resultado.SetValue(texto) self.status.Show(False) #self.Update() if res: module2.MError(self, u"Se generaron mensajes de diagn\xf3stico") self.btnGuardarReporte.Show() module2.MError(self, u"Se gener\xf3 el archivo "+archivo+'.gpg')
def LoadDataGrupo(self): if status.grupoActual.nombre: self.textCtrlNombre.SetValue(status.grupoActual.nombre ) else: self.textCtrlNombre.SetValue('') if status.grupoActual.contacto: self.textCtrlContacto.SetValue(status.grupoActual.contacto) else: self.textCtrlContacto.SetValue('') if status.grupoActual.sigla: self.textCtrlSigla.SetValue(status.grupoActual.sigla) else: self.textCtrlSigla.SetValue('') self.txtId.SetLabel( str(status.grupoActual.id)) Ihash = str(status.grupoActual.id) Ihash = myHash(Ihash) self.txtHash.SetLabel( str(Ihash))
def SaveData(self): global seHaGuardado self.registro = session.query(ConfigTdt).filter(ConfigTdt.tipo == u"OrgData").all() registro = self.registro if registro: registro = registro[0] else: registro = ConfigTdt(u"OrgData") registro.descripcion = u"Datos de la organizacion" opciones = {} for campo in ["txtNombre", "txtMembrete", "txtHash"]: ctrl = getattr(self, campo) tmpA = ctrl.GetValue() opciones[campo] = tmpA.encode("utf-8") i = self.txtClave.GetValue() opciones["txtClave"] = str(i).encode("utf-8") # opciones['browserLogo'] = self.browserLogo.GetValue() opciones["Estado"] = self.Estado opciones["Municipio"] = self.Municipio errorHash = False if opciones["txtHash"]: if opciones["txtHash"] != myHash(opciones["txtClave"]): MError( self, u"El c\xf3digo de verificaci\xf3n no corresponde a la clave de la organizaci\xf3n. Debes corregirlo o dejarlo en blanco", ) errorHash = True else: MError(self, u"El c\xf3digo de verificaci\xf3n no esta presente") aDebug = pickle.dumps(opciones) if not errorHash: registro.contenido = pickle.dumps(opciones) session.add(registro) session.flush() MError(self, u"Se ha grabado la informaci\xf3n de la organizaci\xf3n") seHaGuardado = True else: MError(self, u"La informaci\xf3n de la organizaci\xf3n no se ha grabado")