GNOME Bugzilla – Bug 632185
repository.get_infos should list all implemented infos.
Last modified: 2010-11-04 21:55:34 UTC
Make repository.get_infos to return all the pygi-implemented infos given a Namespace instead of failing when one of the infos in the NameSpace is not implemented by pygi.
Created attachment 172400 [details] [review] repository.get_infos should list all implmented infos.
Review of attachment 172400 [details] [review]: Is there any good reason for not having a test case for this? Also, please remove all tabs and use spaces instead. ::: gi/pygi-repository.c @@ +179,2 @@ if (py_info == NULL) { + PyErr_Clear (); But this is going to clear as well other errors. Some alternatives: - Only call _pygi_info_new for infos that are implemented. - Change _pygi_info_new to not raise a Python exception when there is no wrapper implemented, and just return NULL. - Make sure we implement all wrappers.
Created attachment 172445 [details] [review] implement missing info bindings The following patch takes the alternative of implementing all the previously not-implementing bindings. Should I still add a test?
Yes please include a test
I'm going to commit this for the release. Jose, when you get a chance can you write a test just for insurance. I don't think this will break anything but it would be nice to know perhaps if we miss coverage somewhere.
For some reason with this patch applied I am getting: NotImplementedError: <gi.UnionInfo object (Event) at 0x0x108f650>
Ah, so I think you might be registering some of the types wrong. If we hit an attr that is registered as PyGIBaseInfo_Type we will throw a NotImplemented error in module.py. Any Info which can be an attr of the module must be an instance of PyGIRegisteredTypeInfo_Type. Any reason UnionInfo was redefined to be registered to PyGIBaseInfo_Type? I'm going to commit this to see if anyone reports an issue. A quick look seems to imply that the other infos will never be a member of a module but we should consider that they may need to inherit from one of the other types.
Comment on attachment 172445 [details] [review] implement missing info bindings Committed with fix for UnionInfo. Please make sure PyGIBaseInfo_Type is the correct base type for the added infos. If not please submit a patch to fix this.
getting this out of the queue.