123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- from __future__ import absolute_import
- from __future__ import division
- from __future__ import print_function
- from __future__ import unicode_literals
- import os
- import sys
- if sys.version_info.major < 3:
- import __builtin__ as builtins
- else:
- import builtins
- debug = os.getenv('GI_SCANNER_DEBUG')
- if debug:
- if 'pydevd' in debug.split(','):
-
- pydevdpath = os.getenv('PYDEVDPATH', None)
- if pydevdpath is not None and os.path.isdir(pydevdpath):
- sys.path.insert(0, pydevdpath)
- import pydevd
- pydevd.settrace()
- else:
- def on_exception(exctype, value, tb):
- print("Caught exception: %r %r" % (exctype, value))
- import pdb
- pdb.pm()
- sys.excepthook = on_exception
- if os.name == 'nt':
- datadir = os.path.join(os.path.dirname(__file__), '..', 'share')
- pylibdir = os.path.join(os.path.dirname(__file__), '..', 'lib', 'gobject-introspection')
- else:
- datadir = "/usr/share"
- pylibdir = os.path.join('/usr/lib', 'gobject-introspection')
- builtins.__dict__['DATADIR'] = datadir
- srcdir = os.getenv('UNINSTALLED_INTROSPECTION_SRCDIR', None)
- if srcdir is not None:
- pylibdir = srcdir
- sys.path.insert(0, pylibdir)
- from giscanner.scannermain import scanner_main
- sys.exit(scanner_main(sys.argv))
|