2 """git-cola: The highly caffeinated Git GUI"""
3 from __future__
import absolute_import
, division
, print_function
, unicode_literals
9 Copyright (C) 2007-2020 David Aguilar and contributors
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License version 2 as
13 published by the Free Software Foundation.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
23 def setup_environment():
24 """Provide access to the cola modules"""
25 abspath
= os
.path
.abspath(__file__
)
26 prefix
= os
.path
.dirname(os
.path
.dirname(os
.path
.realpath(abspath
)))
27 install_lib
= os
.path
.join(prefix
, str('share'), str('git-cola'), str('lib'))
28 win_pkgs
= os
.path
.join(prefix
, str('pkgs'))
29 # Use the private modules from share/git-cola/lib when they exist.
30 # It is assumed that that our modules to be present in sys.path through python's
31 # site-packages directory when the private modules do not exist.
32 if os
.path
.exists(install_lib
):
33 sys
.path
.insert(1, install_lib
)
34 elif os
.path
.exists(win_pkgs
):
35 sys
.path
.insert(1, win_pkgs
)
38 if __name__
== '__main__':
40 from cola
.main
import main