forked from git-cola/git-cola
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·76 lines (59 loc) · 1.95 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python
import os
import sys
from glob import glob
from distutils.core import setup
# Look for modules in the root
srcdir = os.path.dirname(os.path.abspath(__file__))
from extras import cmdclass
here = os.path.dirname(__file__)
version = os.path.join(here, 'cola', '_version.py')
scope = {}
exec(open(version).read(), scope)
version = scope['VERSION']
def main():
"""Runs distutils.setup()"""
scripts = [
'bin/git-cola',
'bin/git-dag',
]
if sys.platform == 'win32':
scripts.append('contrib/win32/cola')
setup(name='git-cola',
version=version,
description='The highly caffeinated git GUI',
long_description='A sleek and powerful git GUI',
license='GPLv2',
author='David Aguilar',
author_email='davvid@gmail.com',
url='http://git-cola.github.io/',
scripts=scripts,
cmdclass=cmdclass,
platforms='any',
data_files = cola_data_files())
def cola_data_files():
data = [
_app_path('share/git-cola/bin', '*'),
_app_path('share/git-cola/icons', '*.png'),
_app_path('share/git-cola/icons', '*.svg'),
_app_path('share/applications', '*.desktop'),
_app_path('share/doc/git-cola', '*.rst'),
_app_path('share/doc/git-cola', '*.html'),
_package('cola'),
_package('cola.models'),
_package('cola.widgets'),
]
data.extend([_app_path(localedir, 'git-cola.mo')
for localedir in glob('share/locale/*/LC_MESSAGES')])
return data
def _package(package, subdir=None):
subdirs = package.split('.')
app_dir = os.path.join('share', 'git-cola', 'lib', *subdirs)
if subdir:
subdirs.insert(0, subdir)
src_dir = os.path.join(*subdirs)
return (app_dir, glob(os.path.join(src_dir, '*.py')))
def _app_path(dirname, entry):
return (dirname, glob(os.path.join(dirname, entry)))
if __name__ == '__main__':
main()