def install_gobject_iteration():
 from kivy.clock import Clock
 try:
  from gi.repository import GObject as gobject
 except ImportError:
  import gobject
 if hasattr(gobject, '_gobject_already_installed'):
  return
 gobject._gobject_already_installed = True
 loop = gobject.MainLoop()
 gobject.threads_init()
 context = loop.get_context()
 def _gobject_iteration(*largs):
  loop = 0
  while (context.pending() and (loop < 10)):
   context.iteration(False)
   loop += 1
 Clock.schedule_interval(_gobject_iteration, 0)

def install_gobject_iteration ( ) : from kivy . clock import Clock try : from gi . repository import GObject as gobject except ImportError : import gobject if hasattr ( gobject , '_gobject_already_installed' ) : return gobject . _gobject_already_installed = True loop = gobject . MainLoop ( ) gobject . threads_init ( ) context = loop . get_context ( ) def _gobject_iteration ( * largs ) : loop = 0 while ( context . pending ( ) and ( loop < 10 ) ) : context . iteration ( False ) loop += 1 Clock . schedule_interval ( _gobject_iteration , 0 )
import and install gobject context iteration inside our event loop .