Hi,

Thanks for the pointers! My current system reports

(Gtk.get_major_version(), Gtk.get_minor_version(),
Gtk.get_micro_version()) 3.4.2
GObject.pygobject_version: (3, 2, 2)
GObject._version: 2.0

What is GObject._version: 2.0 referring to?

At the moment I don't want to drive logic based on the version numbers
but put some useful infromation into a programs 'About' box in order
to diagnose issues like the one I inquired about separately regarding
GFileInfo.get_modification_time()

Thanks!
Christian

On Mon, Nov 19, 2012 at 12:42 AM, Simon Feltman <s.felt...@gmail.com> wrote:
> Versioning seems a bit convoluted at the moment. If you are looking for
> specific Gtk+ features based on version (not pygobject features) use the
> Gtk+ library versions (Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION,
> Gtk.MICRO_VERSION)
>
> PyGObject is only providing overrides for the gtk+ typelib, so I would not
> necessarily rely on pygobject versioning for anything being pulled in
> through the gi.repository. GObject and Gio are part of GLib, and you can
> access the version of those with:
> (GLib.MAJOR_VERSION, GLib.MINOR_VERSION, GLib.MICRO_VERSION)
>
> Unfortunately, do to the Gtk overrides currently being delivered with
> pygobject, there may be Gtk override updates tied to specific pygobject
> versions. Depending on what you are trying to achieve, a more robust
> technique might be to use "hasattr" for checking if something is available.
>
> -Simon
>
> On Sun, Nov 18, 2012 at 2:12 PM, Osmo Salomaa <otsal...@iki.fi> wrote:
>>
>> 18.11.2012 20:00, Christian Mallwitz wrote:
>> > There was a time one could do
>> >
>> >>>> import gtk
>> >>>> gtk.pygtk_version
>> > (2, 17, 0)
>> >
>> > How can I do the same with gi.repository.Gtk when using
>> > gobject-introspection from within Python 2?  How about GLib and/or
>> > Gio?
>>
>> >>> from gi.repository import GObject
>> >>> GObject.pygobject_version
>> (3, 2, 2)
>>
>> And since there is no PyGLib or PyGio, you don't do the same for those.
>> PyGObject provides the bindings for GObject, Gtk, GLib and any other
>> libraries that support gobject introspection.
>>
>> --
>> Osmo Salomaa <otsal...@iki.fi>
>> _______________________________________________
>> pygtk mailing list   pygtk@daa.com.au
>> http://www.daa.com.au/mailman/listinfo/pygtk
>> Read the PyGTK FAQ: http://faq.pygtk.org/
>
>
>
> _______________________________________________
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to