grep: remember scrollbar and text cursor when refreshing
[git-cola.git] / setup.py
blob9020b7215ea6e9a1b075d2faaa92b8e54020cfda
1 #!/usr/bin/env python
3 import os
4 import sys
5 from glob import glob
6 from distutils.core import setup
8 # Look for modules in the root
9 srcdir = os.path.dirname(os.path.abspath(__file__))
11 from extras import cmdclass
13 here = os.path.dirname(__file__)
14 version = os.path.join(here, 'cola', '_version.py')
15 scope = {}
16 exec(open(version).read(), scope)
17 version = scope['VERSION']
20 def main():
21 """Runs distutils.setup()"""
23 scripts = [
24 'bin/git-cola',
25 'bin/git-dag',
28 if sys.platform == 'win32':
29 scripts.append('win32/cola')
31 setup(name='git-cola',
32 version=version,
33 description='The highly caffeinated git GUI',
34 long_description='A sleek and powerful git GUI',
35 license='GPLv2',
36 author='David Aguilar',
37 author_email='davvid@gmail.com',
38 url='http://git-cola.github.io/',
39 scripts=scripts,
40 cmdclass=cmdclass,
41 platforms='any',
42 data_files = cola_data_files())
44 def cola_data_files():
45 data = [
46 _app_path('share/git-cola/bin', '*'),
47 _app_path('share/git-cola/icons', '*.png'),
48 _app_path('share/git-cola/icons', '*.svg'),
49 _app_path('share/applications', '*.desktop'),
50 _app_path('share/doc/git-cola', '*.txt'),
51 _app_path('share/doc/git-cola', '*.html'),
52 _package('cola'),
53 _package('cola.classic'),
54 _package('cola.main'),
55 _package('cola.merge'),
56 _package('cola.models'),
57 _package('cola.prefs'),
58 _package('cola.stash'),
59 _package('cola.widgets'),
62 data.extend([_app_path(localedir, 'git-cola.mo')
63 for localedir in glob('share/locale/*/LC_MESSAGES')])
64 return data
67 def _package(package, subdir=None):
68 subdirs = package.split('.')
69 app_dir = os.path.join('share', 'git-cola', 'lib', *subdirs)
70 if subdir:
71 subdirs.insert(0, subdir)
72 src_dir = os.path.join(*subdirs)
73 return (app_dir, glob(os.path.join(src_dir, '*.py')))
76 def _app_path(dirname, entry):
77 return (dirname, glob(os.path.join(dirname, entry)))
80 if __name__ == '__main__':
81 main()