GNOME Bugzilla – Bug 121544
GObject property flags are not working
Last modified: 2006-01-09 14:11:24 UTC
I created a property with the gobject.PARAM_READABLE flags and object.set_property() is not giving an error with that property. I'll attach some code to show what I mean.
Created attachment 19765 [details] code sample to show the bug
The attached example now prints the following warning for me: >>> print o1.set_property('prop-name', 'other value') (process:12384): GLib-GObject-WARNING **: g_object_set_property: property `prop-name' of object class `__main__+MyObject' is not writable None >>> This seems to have been added by Tim on Nov 27. We should probably be checking this ourselves though, and raising the appropriate exception.
Added some checks to get_property() and set_property() for the readable and writable flags on both branches. I haven't done any checks for construct_only, because Python code might want to call set_property during construction and I can't tell whether that is happening or not. Will have to rely on the C level warning for that ...