-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·58 lines (46 loc) · 1.85 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
#!/usr/bin/env python
import sys
import os
from distutils.core import setup
f=open('data/doc/VERSION', 'r') # Open the VERSION file for reading.
version_string = f.readline()[:-1] # "[:-1]" means we omit the last character, which is "\n".
f.close
def give_files(dir, *extension):
files=[]
all_files=os.listdir(dir)
for file in all_files:
ext=(os.path.splitext(file))[1]
if ext in extension:
files.append(dir + file)
return files
i18n_languages = "fr cs de es it pt_BR ro sv tr"#list all the languages, separated by one whitespace
def give_mo_file(lang):
return "po/" + str(lang) + "/specto.mo"
def give_mo_path(lang):
return "share/locale/" + str(lang) + "/LC_MESSAGES/"
def give_mo_tuples(langs):
mo_tuple_list=[]
for lang in langs.split(' '):
mo_tuple_list.append( (give_mo_path(lang),[give_mo_file(lang)]) )
return mo_tuple_list
temp_files = [#The path are relatives to sys.prefix
('share/doc/specto', give_files('data/doc/', '')),
('share/icons/hicolor/scalable/apps', ['data/icons/hicolor/scalable/specto.svg']),
('share/applications', ['specto.desktop']),
('share/specto/icons', give_files('data/icons/', '.png', '.svg')),
('share/specto/glade', give_files('data/glade/', '.glade'))
]
for lang_tuple in give_mo_tuples(i18n_languages):
temp_files.append(lang_tuple)
setup(name = "specto",
version = version_string,
description = "A desktop application that will watch configurable events (website updates, emails, file and folder changes...)",
author = "Jean-Francois Fortin Tam",
author_email = "nekohayo at gmail dot com",
url = "http://specto.sourceforge.net",
packages = ['spectlib'],
#package_dir = {'': 'src'},
#package_data = {'specto': ['preferences.glade','notify.glade']},
scripts = ['specto'],
data_files = temp_files
)