Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.