示例#1
0
        def run(self):
            while not self.end :

                # Obtener dia, horas, minutos, segundos de la
                # diferencia desde que empezó hasta ahora
                date = min_format(time.time() - self.tstart)

                # Actualizar la hora
                try:
                    gtk.gdk.threads_enter()
                    self.label.set_text(date)
                finally:
                    gtk.gdk.threads_leave()

                # Dormir el thread un segundo
                time.sleep(1)

                # Comprobar el thread padre
                if self.padre is not None :
                    self.end = self.padre.poll() is not None
示例#2
0
 def stime(self):
     """@brief Devuelve el tiempo acumulado en una cadena."""
     return min_format(self.time())