GNOME Bugzilla – Bug 743468
Add namespace and container name to callable cache and include them in all warnings/error messages
Last modified: 2015-03-03 12:08:47 UTC
Created attachment 295363 [details] [review] patch v1 b = Gtk.Button() b.set_label(1,2,3) before: TypeError: set_label() takes exactly 2 arguments (4 given) after: TypeError: Gtk.Button.set_label() takes exactly 2 arguments (4 given) ########## Gtk.Arrow.new(Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE) before: DeprecationWarning: Gtk.new is deprecated after: DeprecationWarning: Gtk.Arrow.new is deprecated ########## table = Gtk.Table() table.set_homogeneous(True) before: DeprecationWarning: Gtk.set_homogeneous is deprecated after: DeprecationWarning: Gtk.Table.set_homogeneous is deprecated
(In reply to comment #0) > b = Gtk.Button() > b.set_label(1,2,3) > > before: TypeError: set_label() takes exactly 2 arguments (4 given) > after: TypeError: Gtk.Button.set_label() takes exactly 2 arguments (4 given) I'd like to add that Python itself only prints the function name in this case, so the new behavior is inconsistent. I personally like the additional info, but if consistency is preferred I'm happy to revert those cases.
Review of attachment 295363 [details] [review]: Looks good, just some minor style nitpicks. ::: gi/pygi-cache.c @@ +668,3 @@ cache->name = g_base_info_get_name ((GIBaseInfo *) callable_info); + cache->namespace = g_base_info_get_namespace ((GIBaseInfo *) callable_info); + container = g_base_info_get_container((GIBaseInfo *) callable_info); Space needed after function name and before open parenthesis. @@ +671,3 @@ + cache->container_name = NULL; + /* https://bugzilla.gnome.org/show_bug.cgi?id=709456 */ + if (container != NULL && g_base_info_get_type(container) != GI_INFO_TYPE_TYPE) { here too @@ +679,3 @@ const gchar *deprecated = g_base_info_get_attribute (callable_info, "deprecated"); gchar *warning; + gchar *full_name = pygi_callable_cache_get_full_name(cache); same @@ +711,3 @@ +{ + if (cache->container_name != NULL) { + return g_strjoin(".", same @@ +717,3 @@ + NULL); + } else { + return g_strjoin(".", same
Created attachment 295564 [details] [review] patch v2 Thanks!
Review of attachment 295564 [details] [review]: LGTM, Thanks!