1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
'''
Created on Feb 4, 2013
@author: Samu
'''
import gtk
from gui.ContenedorTareas import ContenedorTareas
import suds
from suds.client import Client
class Temas(gtk.VBox):
# This is a callback function. The data arguments are ignored
# in this example. More on callbacks below.
WSDL_URL = 'http://localhost:8080/EjercitarServer/EjercitarWSBean?wsdl'
def __init__(self, ventana_padre, id_alumno, ayuda_padres, desde_hogar, estado_animo):
# create a new window
super(Temas, self).__init__()
self.ventana_padre = ventana_padre
self.id_alumno = id_alumno
self.ayuda_padres = ayuda_padres
self.desde_hogar = desde_hogar
self.estado_animo = estado_animo
self.__inicializar_componentes()
self.cliente_WS = self.__sincronizar_temas()
self.__organizar_gui(self.cliente_WS)
self.show_all()
def __inicializar_componentes(self):
self.label = gtk.VBox()
self.label_titulo = gtk.Label('<span size="xx-large"> <b> Tareas </b> </span>')
#self.label_titulo = gtk.Label('<span size="20">Tareas</span>')
self.label_titulo.set_use_markup(True)
self.label_sub_titulo = gtk.Label('<span size="x-large"><i>Elige una tarea para continuar</i></span>')
self.label_sub_titulo.set_use_markup(True)
self.label.add(self.label_titulo)
self.label.add(self.label_sub_titulo)
def __organizar_gui(self, cliente_WS):
table = gtk.Table(6, 6, gtk.TRUE) #dinamico
contenedor_lista = gtk.VBox()
lista_tareas = cliente_WS.service.getTareas(self.id_alumno)
for tarea in lista_tareas:
nueva_tarea = ContenedorTareas(self.id_alumno, tarea.idTarea, tarea.descripcion, self.ventana_padre, self, self.cliente_WS, self.ayuda_padres, self.desde_hogar, self.estado_animo)
contenedor_lista.add(nueva_tarea)
#frame.add(contenedor_lista)
self.add(table)
table.attach(self.label, 0,6,0, 1)
table.attach(contenedor_lista, 1, 5, 1, 5)
self.show_all()
def __sincronizar_temas(self):
try:
cliente_WS = Client(self.WSDL_URL)
except:
print "\n\nERROR al instanciar el SINCRONIZAR PROXY:"
return cliente_WS
|