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