giscanner: Support srcdir != builddir
authorColin Walters <walters@verbum.org>
Thu, 23 Jun 2011 21:26:57 +0000 (17:26 -0400)
committerColin Walters <walters@verbum.org>
Thu, 23 Jun 2011 21:26:57 +0000 (17:26 -0400)
__path__ modification trick from Johan Dahlin.

giscanner/__init__.py

index 5614288..5ab7a95 100644 (file)
@@ -17,3 +17,8 @@
 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 #
+
+import os
+builddir = os.environ.get('UNINSTALLED_INTROSPECTION_BUILDDIR')
+if builddir is not None:
+    __path__.append(os.path.join(builddir, 'giscanner'))