I'm trying to port some pygtk music player code to pygi which uses gst's discoverer module.
from gi.repository import Gst, GstPbutils
def on_discovered(discoverer, ismedia):
print("%s -- %s" %( discoverer.tags.get('title', 'Unknown'),
discoverer.tags.get('artist', 'Unknown')))
Gst.init(None)
location = "file:///srv/Music/molly_hatchet-the_creeper.mp3"
discoverer = GstPbutils.Discoverer()
discoverer.discover_uri(location)
discoverer.connect('discovered', on_discovered)
When I attempt to run this I get the following error:
/usr/lib/python2.7/dist-packages/gi/types.py:43: Warning: g_object_get_qdata: assertion `G_IS_OBJECT (object)' failed
return info.invoke(*args, **kwargs)
/usr/lib/python2.7/dist-packages/gi/types.py:43: Warning: g_object_ref_sink: assertion `G_IS_OBJECT (object)' failed
return info.invoke(*args, **kwargs)
** (python:21482): CRITICAL **: pygobject_register_wrapper: assertion `PyObject_TypeCheck(self, &PyGObject_Type)' failed
/usr/lib/python2.7/dist-packages/gi/types.py:43: Warning: g_object_unref: assertion `G_IS_OBJECT (object)' failed
return info.invoke(*args, **kwargs)
Unfortunately documentation on this pygi module seems a bit sparse.
For now I've reverted back to pygtk, but I'd love to know how to make this work with pygi since that's going to be the way forward with Ubuntu.