After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748221 - Add some pygobject snippets
Add some pygobject snippets
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: snippets
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-20 23:55 UTC by Patrick Griffis (tingping)
Modified: 2016-02-21 23:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add some pygobject snippets (1.25 KB, patch)
2015-04-20 23:55 UTC, Patrick Griffis (tingping)
none Details | Review
Add some pygobject snippets (994 bytes, patch)
2015-04-21 00:17 UTC, Patrick Griffis (tingping)
none Details | Review
Add some pygobject snippets (1005 bytes, patch)
2015-04-21 00:33 UTC, Patrick Griffis (tingping)
committed Details | Review

Description Patrick Griffis (tingping) 2015-04-20 23:55:54 UTC
Created attachment 302032 [details] [review]
Add some pygobject snippets

As title says.
Comment 1 Patrick Griffis (tingping) 2015-04-21 00:17:40 UTC
Created attachment 302033 [details] [review]
Add some pygobject snippets

Removed gproperty_full because its exact format actually depends on some more information...
Comment 2 Patrick Griffis (tingping) 2015-04-21 00:33:15 UTC
Created attachment 302035 [details] [review]
Add some pygobject snippets

Always include default values like the C versions
Comment 3 Christian Hergert 2015-04-30 19:02:43 UTC
Thanks!

Attachment 302035 [details] pushed as b69f1f3 - Add some pygobject snippets
Comment 4 Garrett Regier 2015-04-30 19:31:18 UTC
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.
Comment 5 Christian Hergert 2016-02-21 23:10:36 UTC
Addressing some of gregier's comments.