PyGObject - GLib/GObject/GIO Python bindings
PyGObject is a Python dynamic module that enables developers to use the power of GObject, which is part of the GNOME platform.
The goal of PyGObject is to fully support GObject introspection and all its features (callbacks, GVariant support, closures, etc.).
Reference documentation is now being generated via g-ir-doc-tool in the gobject-introspection project. This is a work in progress and as of now produces documentation which may not be that useful. Please visit the GObject Introspection Documentation project page to see how you can generate documentation directly from .gir files and read up on how to contribute to the project. Examples of the output for Gtk+ are also available to browse.
Getting the code
git clone git://git.gnome.org/pygobject (browse)
For now it is suggested that PyGObject Introspection be run in a sandbox environment. The best way to do that is with jhbuild.
follow Jhbuild build instructions until (including) "jhbuild bootstrap"
Use the "gnome-apps-3.2" module set (we depend on GLib & GObject Introspection HEAD for now)
- Add the following lines to ~/.jhbuildrc.:
moduleset = "gnome-apps-3.2" branches["pygobject"] = "master" modules = ['gtk+', 'pygobject']
To start building, run:
jhbuild build gtk+ pygobject
To activate jhbuild environment, run "jhbuild shell". After that, the specific console session will make use of the sandbox and you will be able to use PyGObject. Verify:
$ python import gi print gi.__file__
PyGObject comes with many test cases. To run them, use
$ make check
Tests may be run in gdb or valgrind, using "check.gdb" and "check.valgrind", respectively.
Moreover, select tests may be run only:
$ make check TEST_NAMES="test_gi.TestConstant.test_constant_number test_gi.TestBoolean test_overrides"
This works with "check.gdb" and "check.valgrind" too.
Support and Feedback
Bugs and patches
Please file bug reports in Bugzilla for component "introspection". Thanks!
Patches need to be accompanied with tests, if there were none.
Contact and discussion
Porting PyGTK to PyGObject
Translations of this page
PyGObject_ru - Russian translations