-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.py
More file actions
61 lines (47 loc) · 1.52 KB
/
setup.py
File metadata and controls
61 lines (47 loc) · 1.52 KB
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
#!/usr/bin/env python
# setup.py
#
# Copyright (C) 2014, 2015 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
import os
from distutils.core import setup
pkg_data = ["media/*", "css/*"]
def get_stages():
stages = []
stages_root = 'kano_init_flow/stages'
entries = os.listdir(stages_root)
for e in entries:
if os.path.isdir(os.path.join(stages_root, e)):
stages.append("kano_init_flow.stages.{}".format(e))
return stages
def get_stages_data():
stages = get_stages()
data = {}
for s in stages:
root = s.replace('.', '/')
for f in pkg_data:
subdir = f.split('/')[0]
if os.path.isdir(os.path.join(root, subdir)):
if s not in data:
data[s] = []
data[s].append(f)
return data
def merge_dicts(a, b):
res = a.copy()
res.update(b)
return res
setup(
name='kano-init-flow',
version='2.2.0',
description='The init flow for Kano OS',
author='Kano Computing',
author_email='help@kano.me',
packages=['kano_init_flow', 'kano_init_flow.stages', 'kano_init_flow.ui',
'kano_init_flow.kw_slideshow'] + get_stages(),
scripts=['bin/kano-init-flow', 'bin/kano-init-flow-system-tool',
'bin/kano-world-slideshow'],
package_data=merge_dicts({"kano_init_flow.ui": pkg_data,
"kano_init_flow.kw_slideshow": pkg_data,
}, get_stages_data())
)