3 """Takes care of starting the main function
7 Copyright (C) 2007, 2008, 2009 David Aguilar <davvid@gmail.com> and contributors
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
27 """Provides access to the cola modules"""
28 # Try to detect where it is run from and set prefix and the search path.
29 # It is assumed that the user installed Cola using the --prefix= option
30 prefix
= os
.path
.dirname(os
.path
.abspath(__file__
))
31 if 'Contents/Resources' not in __file__
:
32 prefix
= os
.path
.dirname(prefix
)
34 # Look for modules in the source or install trees
35 thirdparty
= os
.path
.join(prefix
, 'thirdparty')
36 if os
.path
.exists(thirdparty
):
37 paths_to_try
= [prefix
, thirdparty
]
39 paths_to_try
= [os
.path
.join(prefix
, 'share', 'git-cola', 'lib')]
41 sys
.path
= paths_to_try
+ sys
.path
43 # Setup the path so that git finds us when we run 'git cola'
44 path_entries
= os
.environ
.get('PATH').split(os
.pathsep
)
45 bindir
= os
.path
.dirname(os
.path
.abspath(__file__
))
46 path_entries
.insert(0, bindir
)
47 path
= os
.pathsep
.join(path_entries
)
48 os
.environ
['PATH'] = path
49 os
.putenv('PATH', path
)
52 if __name__
== '__main__':
53 # lights, cameras, action