예제 #1
0
 def on_tbtnNuevoProyecto_clicked(self, *args):
     modelo = self.lvwClase.get_model()   
     dlg = dlgProyecto(padre=self.wnPrincipal)
     response = dlg.dlgProyecto.run()
     if response == gtk.RESPONSE_OK:
         path = dlg.entRuta.get_text() + "/" + dlg.entNombre.get_text()
         treeIter = modelo.append(None, [dlg.entNombre.get_text(), path])
         self.nombre = dlg.entNombre.get_text()
         self.path = path
     
     DjangoGui.escribe(self.lvwClase.get_model())
     escribe_urls.escribe(path)
예제 #2
0
 def on_tbtnAgregarAplicacion_clicked(self, *args):
     modelo, puntero = self.lvwClase.get_selection().get_selected()
     if modelo is None or puntero is None:
         return
 
     dlg = dlgAplicacion(padre=self.wnPrincipal)
     response = dlg.dlgAplicacion.run()
     puntero = modelo.get_iter_first() 
         
     if response == gtk.RESPONSE_OK:
         modelo.append(puntero, [dlg.entAplicacion.get_text(), "aplicacion"])
    
         crear_aplicacion(modelo.get_value(puntero, 1),
                           dlg.entAplicacion.get_text())
         DjangoGui.escribe(self.lvwClase.get_model())
         self.apps.append("%s.%s" %(self.nombre, dlg.entAplicacion.get_text()))
         self.escribe_apps()
         
     self.lvwClase.expand_all()
예제 #3
0
 def on_tbtnAbrirProyecto_clicked(self, *args):
     path = dlgAbrirArchivo("DjangoGUI", self.padre , ["*.DjangoGui"])
     
     if path is not None:
         modelo = self.lvwClase.get_model()
         datos = DjangoGui.lee(path) 
         padre = modelo.append(None,[datos[0],datos[1]])
         self.path = datos[1]
         self.nombre = datos[0]
         
         for aplicacion in datos[2]:
             ruta = "%s%s/models.py" % (datos[1], aplicacion)
             app = modelo.append(padre, [aplicacion, "aplicacion"])
             modelos = Modelos(ruta)
             
             if modelos.get_modelos() <> []:    
                 self.temp_modelos.append([aplicacion, modelos.get_modelos()])
             
             for clase in modelos.get_modelos():
                 self.tablas.append([clase[0],aplicacion])
                 modelo.append(app, [clase[0], "modelo"])
                 
     self.lvwClase.expand_all()