def restoreBackup(self, name, base): if not name: MError(self, u"A\xfan no hay un archivo de respaldo seleccionado") return False if validaRespaldo(self, name): pgpath = path_postgres.path_postgres() if pgpath: comando = '%s\\utils\\restore.bat "%s" %s "%s" '%(status.drive+status.path, name, cnf.passwd, pgpath) os.system(comando) MError(self, u"Operaci\xf3n realizada") return True else: MError(self, u"No fue posible localizar la instalacion de PostgreSQL") else: MError(self, u"El archivo de respaldo no parece contener informaci\xf3n v\xe1lida para el SMDH")
def OnBtnCrearBaseButton(self, event): try: pgpath = path_postgres.path_postgres() if pgpath: comando = '%s\\utils\\crearbase-aut2.bat %s %s "%s" '%(status.drive+status.path, cnf.passwd, cnf.db, pgpath) os.system(comando) MError(self, u"Operaci\xf3n realizada. El sistema ser\xe1 cerrado ahora.") else: MError(self, u"No fue posible localizar la instalacion de PostgreSQL") except: MError(self, u"La operaci\xf3n no pudo ser efectuada") tb=sys.exc_info()[2] #traceback.print_tb(tb) traceback.print_exc() sys.exit() sys.exit() event.Skip()
def Parche(self, DBversion): pgpath = path_postgres.path_postgres() if pgpath: try: comando = '%s\\parches\\aplicaparchev25.bat %s %s "%s" '%(status.drive+status.path, cnf.passwd, cnf.db, pgpath) os.system(comando) FijaVersion(self, cnf.PRGversion) except: MError(self, u"La operaci\xf3n no pudo ser efectuada") tb=sys.exc_info()[2] traceback.print_exc() sys.exit() else: MError(self, u"No fue posible localizar la instalacion de PostgreSQL") return
def OnButtonRespaldoButton(self, event): pgpath = path_postgres.path_postgres() if pgpath: try: a=datetime.datetime.now() fecha = a.isoformat()[:16].replace(':','') name = 'respaldo'+fecha+'.sql' comando = status.drive+status.path+"\utils\dump_smdh.bat "+' '+status.drive+status.path+"\\archivos\\"+name+' '+cnf.db+' '+cnf.passwd+' '+'"'+pgpath+'"' print "comando:", comando os.system(comando) if validaRespaldo(self, status.drive+status.path+"\\archivos\\"+name): MError(self, u"El archivo de respaldo fue generado en la carpeta\n '%s\\archivos' con el nombre de \n %s.\n Es conveniente trasladar ese archivo a algun medio externo, como un CD o disco r\xedgido externo"%(status.drive+status.path , name)) else: MError(self, u'El archivo de respaldo no pudo ser generado!!!') except: MError(self, u'El procedimiento de respaldo no pudo ser efectuado!!!') else: MError(self, u"No fue posible localizar la instalacion de PostgreSQL") event.Skip()