/usr/share/pyshared/pymt/support.py is in python-pymt 0.5.1-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | '''
Support: activate other framework/toolkit inside our event loop
'''
__all__ = ('install_gobject_iteration', )
def install_gobject_iteration():
'''Import and install gobject context iteration inside our event loop.
This is used as soon as gobject is used (like gstreamer)
'''
from pymt.clock import getClock
import gobject
if hasattr(gobject, '_gobject_already_installed'):
# already installed, don't do it twice.
return
gobject._gobject_already_installed = True
# get gobject mainloop / context
loop = gobject.MainLoop()
gobject.threads_init()
context = loop.get_context()
# schedule the iteration each frame
def _gobject_iteration(*largs):
context.iteration(False)
getClock().schedule_interval(_gobject_iteration, 0)
|