2 # -*- coding: utf-8 -*-
4 from __future__
import (absolute_import
, division
, print_function
,
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/.
25 if __name__
== '__main__':
26 if os
.environ
.get('COVERAGE_PROCESS_START'):
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
:
35 sys
.exec_prefix
= prefix
37 major
, minor
= sys
.version_info
[0:2]
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
),
43 sys
.path
= local_path
+ sys
.path
45 from stgit
.main
import main