-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·42 lines (34 loc) · 1.2 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
#!/usr/bin/python
import os
from distutils.core import setup
import batterym.fileio as fileio
import batterym.paths as paths
import batterym.config as config
def find_resources(folder):
target_folder = os.path.join(paths.RESOURCES_DIR, folder)
fnames = os.listdir(folder)
resources = [os.path.join(folder, x) for x in fnames]
return (target_folder, resources)
version = config.get_entry('version', 'config/config_default.json')
print 'batterym v{0}'.format(version)
print 'installation path:', paths.RESOURCES_DIR
setup(name='batterym',
version=version,
description='Battery Monitor for Ubuntu',
url='https://github.com/maks-a/batterym',
author='https://github.com/maks-a',
license='Apache License 2.0',
packages=['batterym'],
data_files=[
(paths.SHARE_APP_DIR, ['batterym.desktop']),
(paths.RESOURCES_DIR, []),
(find_resources('config')),
(paths.LOGS_DIR, []),
(find_resources('img')),
],
scripts=['bin/batterym']
)
fileio.create_missing_dirs(paths.LOGS_DIR)
fileio.append('', paths.LOG_BATTERY_FILE)
fileio.append('', paths.LOG_BATTERY_ALL_FILE)
print 'batterym is successfully installed.'