Remove unneeded imports
[stgit.git] / stg
blob81dda9087c7cb926a061e69376c14aa8ccd9c242
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 # -*- python-mode -*-
4 from __future__ import (absolute_import, division, print_function,
5 unicode_literals)
6 import os
7 import sys
9 __copyright__ = """
10 Copyright (C) 2005, Catalin Marinas <catalin.marinas@gmail.com>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License version 2 as
14 published by the Free Software Foundation.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, see http://www.gnu.org/licenses/.
23 """
25 if __name__ == '__main__':
26 if os.environ.get('COVERAGE_PROCESS_START'):
27 import coverage
28 coverage.process_startup()
30 # Try to detect where it is run from and set prefix and the search path.
31 # It is assumed that the user installed StGIT using the --prefix= option
32 prefix, bin = os.path.split(sys.path[0])
33 if bin == 'bin' and prefix != sys.prefix:
34 sys.prefix = prefix
35 sys.exec_prefix = prefix
37 major, minor = sys.version_info[0:2]
38 local_path = [
39 os.path.join(prefix, 'lib', 'python'),
40 os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor)),
41 os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor),
42 'site-packages')]
43 sys.path = local_path + sys.path
45 from stgit.main import main
47 main()