GNOME Bugzilla – Bug 748221
Add some pygobject snippets
Last modified: 2016-02-21 23:10:36 UTC
Created attachment 302032 [details] [review] Add some pygobject snippets As title says.
Created attachment 302033 [details] [review] Add some pygobject snippets Removed gproperty_full because its exact format actually depends on some more information...
Created attachment 302035 [details] [review] Add some pygobject snippets Always include default values like the C versions
Thanks! Attachment 302035 [details] pushed as b69f1f3 - Add some pygobject snippets
gedit's snippet for a new GObject class: https://git.gnome.org/browse/gedit/tree/plugins/snippets/data/python.xml#n30 It is missing the $SUPER_CLASS.__init__() bit, for Python 2 that is fine. However, in Python 3 I would think super().__init__() is use more. It is also missing the parameters from $3. Finally, it is not supplied by the Python class snippet. The __gtype_name__ is no longer required for PyGObject types, it will be given a name with respect to its filename and Python class name. GObject.property has been deprecated and now emits a nice big warning, use GObject.Property instead. https://git.gnome.org/browse/libpeas/commit/?id=cbe30d8b89995d24010c51739ed5b1d5c096f82e Similarly, GObject.SIGNAL_RUN_FIRST is also deprecated instead use GObject.SignalFlags.RUN_FIRST.
Addressing some of gregier's comments.