Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/EjercitarClient/gui/Temas.py
blob: eee8826f70f90474205d65366841d4786d2a88f2 (plain)
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
'''
Created on Feb 4, 2013

@author: Samu
'''
'''
Created on Feb 2, 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):
        # create a new window
        super(Temas, self).__init__()
        self.ventana_padre = ventana_padre
        self.id_alumno = id_alumno
        
        self.__inicializar_componentes()   
        self.cliente_WS = self.__sincronizar_temas()
        self.__organizar_gui(self.cliente_WS)   
        self.show_all()
        
    def __inicializar_componentes(self):
        pass
    
    def __organizar_gui(self, cliente_WS):
        
        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)
            contenedor_lista.add(nueva_tarea)
        
            
        self.add(contenedor_lista)
        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