Public feed #377394

eitan

public python v1 · immutable
Raw Edit
·published 2007-03-01 18:31 UTC
rendered paste body
import sysimport gcimport gobjectclass Timer(gobject.GObject):  __gsignals__ = {'time' :                   (gobject.SIGNAL_RUN_FIRST,                   gobject.TYPE_NONE,                    ( ))}  def __init__(self):    gobject.GObject.__init__(self)    gobject.timeout_add(1000, self.Emit)  def Emit(self):    self.emit('time')    return Trueclass Foo:  def __init__(self):    self.timer = Timer()    self.timer.connect('time', self.Handler)  def Handler(self, timer):    print 'time'  def __del__(self):    print 'called!'Foo()mainloop = gobject.MainLoop()mainloop.run()