-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
49 lines (35 loc) · 1.28 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
#!/bin/env python
import os
from setuptools import setup
def find_xdg_data_files(syspath, relativepath, pkgname, data_files=[]):
for (dirname, _, filenames) in os.walk(relativepath):
if filenames:
syspath = syspath.format(pkgname=pkgname)
subpath = dirname.split(relativepath)[1]
if subpath.startswith('/'):
subpath = subpath[1:]
files = [os.path.join(dirname, f) for f in filenames]
data_files.append((os.path.join(syspath, subpath), files))
return data_files
def find_data_files(data_map, pkgname):
data_files = []
for (syspath, relativepath) in data_map:
find_xdg_data_files(syspath, relativepath, pkgname, data_files)
return data_files
DATA_FILES = [
('share/{pkgname}/plugins', 'data/plugins'),
]
setup(
author='Paulius Šukys',
author_email='[email protected]',
description='Tomate plugin to post time spent to Toggl time tracker',
include_package_data=True,
keywords='pomodoro,tomate,toggl',
license='GPL-3',
long_description=open('README.md').read(),
name='tomate-toggl-plugin',
data_files=find_data_files(DATA_FILES, 'tomate'),
url='https://github.com/psukys/tomate-toggl-plugin',
version='0.1.0',
zip_safe=False,
)