cola: add more documentation strings to the cola modules
[git-cola.git] / bin / git-cola
blob135f13ba0a4e2c972b9610f36b8e8086e0bfe42b
1 #!/usr/bin/env python
2 # -*- python-mode -*-
3 """Takes care of starting the main function
4 """
6 __copyright__ = """
7 Copyright (C) 2008, David Aguilar <davvid@gmail.com>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 2 as
11 published by the Free Software Foundation.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 """
23 import os
24 import sys
26 # Put sys.path[0] in our path so that we can find our custom git-* commands
27 path_entries = os.getenv('PATH', '').split(os.pathsep)
28 if sys.path[0] not in path_entries:
29 path_entries.insert(0, sys.path[0])
30 path = os.pathsep.join(path_entries)
31 os.environ['PATH'] = path
33 # Try to detect where it is run from and set prefix and the search path.
34 # It is assumed that the user installed Cola using the --prefix= option
35 prefix, bin = os.path.split(sys.path[0])
37 # Scripts is win32
38 if bin in ('bin', 'Scripts') and prefix != sys.prefix:
39 sys.prefix = prefix
40 sys.exec_prefix = prefix
42 major, minor = sys.version_info[0:2]
43 local_path = [os.path.join(prefix, 'lib', 'python%s.%s' % (major, minor),
44 'site-packages'),
45 os.path.join(prefix, 'Lib', 'site-packages'),
46 prefix,
47 os.getcwd(),
49 sys.path = local_path + sys.path
51 from cola.main import main
53 if __name__ == '__main__':
54 main()