Esempio n. 1
0
  def crearPefil(self):
      if sys.platform == 'linux2':   
	os.system("cp -r /usr/share/pyventa/perfil/* "+libutil.home())
      else:
	os.system("xcopy \usr\share\pyventa\perfil \"%s\" /i /a /e /k"%self.home)
      msgBox=QtGui.QMessageBox(QtGui.QMessageBox.Information,"Reinicio programado","<h2>La operacion ha tenido exito</h2><br><p>Ahora se recopilaran los datos necesarios para la base de datos, despues de eso el programa se cerrara para establecer las configuraciones.</p>.",QtGui.QMessageBox.Close,self)
      msgBox.exec_()
Esempio n. 2
0
 def respaldo(self):
   sql="SHOW TABLES;"
   self.cursor.execute(sql)
   tabs=self.cursor.fetchall()
   fecha=str(datetime.date.today().strftime("%d.%m.%Y"))
   home=libutil.home()
   files=[]
   out = tarfile.TarFile.open(os.path.join(home,"bd.respaldo.%s.tar.bz2"%fecha),'w:bz2')
   for i,tab in enumerate(tabs):
     tabla=self.tablaACsv(tab[0],home)
     files.append(tabla)
     out.add(tabla,arcname="%s.csv"%tab[0])
     os.unlink(tabla)
     print "Progreso: ",(i+1)*100/len(tabs),"%"
   out.close()