diff options
author | Thibault Saunier <thibault.saunier@collabora.com> | 2012-08-21 07:54:09 +0200 |
---|---|---|
committer | Martin Pitt <martinpitt@gnome.org> | 2012-08-23 06:07:18 +0200 |
commit | b1a9848a7a7255e6b1ccd98712dd62b1514078b9 (patch) | |
tree | 46c108cb8ac0c2143ce638d9df35d3680849cb40 /gi/__init__.py | |
parent | c7c95a795eee499373499ea5b771447746317bfb (diff) | |
download | pygobject-b1a9848a7a7255e6b1ccd98712dd62b1514078b9.tar.gz |
Allow overrides in other directories than gi itself
Use pkgutil.extend_path() for the gi and gi.overrides modules, so that
libraries can install overrides in a path that is different from the one that
pygobject installs itself into. These overrides need to put this into their
__init__.py at the top:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
and put themselves somewhere into the default PYTHONPATH.
https://bugzilla.gnome.org/show_bug.cgi?id=680913
Co-Authored-By: Martin Pitt <martinpitt@gnome.org>
Co-Authored-By: Simon Feltman <s.feltman@gmail.com>
Diffstat (limited to 'gi/__init__.py')
-rw-r--r-- | gi/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gi/__init__.py b/gi/__init__.py index b816612a..6ebff8e4 100644 --- a/gi/__init__.py +++ b/gi/__init__.py @@ -20,6 +20,10 @@ from __future__ import absolute_import +# support overrides in different directories than our gi module +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) + from ._gi import _API, Repository # Force loading the GObject typelib so we have available the wrappers for |