summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorjvoisin2012-01-08 19:12:03 +0100
committerjvoisin2012-01-08 19:12:03 +0100
commit153d8d446603250085b384fda1a08e6a7267c7d7 (patch)
tree1e25b4a6a31f3de949efcfa9ad3718fbea9d76df /setup.py
parent66bb682f7f6b6f06c353734149cbe5d71e7744df (diff)
Setup.py now generate locales
Diffstat (limited to '')
-rwxr-xr-xsetup.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index bf109e5..7847163 100755
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,9 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2 2
3import os 3import os
4import sys
5import glob
6import subprocess
4 7
5from distutils.core import setup 8from distutils.core import setup
6 9
@@ -12,21 +15,33 @@ from mat import mat
12if os.path.exists('MANIFEST'): 15if os.path.exists('MANIFEST'):
13 os.remove('MANIFEST') 16 os.remove('MANIFEST')
14 17
18
19def l10n():
20 '''
21 Compile .po files to .mo
22 '''
23 for language in glob.glob('locale/*'):
24 fpath = os.path.join(language, 'LC_MESSAGES', 'mat-gui.po')
25 output = fpath[:-2] + 'mo'
26 subprocess.call(['msgfmt', fpath, '-o', output])
27 yield output
28
15setup( 29setup(
16 name = 'MAT', 30 name = 'MAT',
17 version = mat.__version__, 31 version = mat.__version__,
18 description = 'Metadata Anonymisation Toolkit', 32 description = 'Metadata Anonymisation Toolkit',
19 long_decription = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir', 33 long_description = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir',
20 author = mat.__author__, 34 author = mat.__author__,
21 author_email = 'julien.voisin@dustri.org', 35 author_email = 'julien.voisin@dustri.org',
22 platforms = 'linux', 36 platforms = 'linux',
23 license = 'GPLv2', 37 license = 'GPLv2',
24 url = 'https://mat.boum.org', 38 url = 'https://mat.boum.org',
25 packages = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'], 39 packages = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'],
26 scripts = ['mat-cli', 'mat-gui'], 40 scripts = ['mat-cli', 'mat-gui'],
27 data_files = [ 41 data_files = [
28 ( 'share/applications', [ 'mat.desktop' ] ), 42 ( 'share/applications', ['mat.desktop'] ),
29 ( 'share/mat', ['FORMATS'] ), 43 ( 'share/mat', ['FORMATS'] ),
30 ( 'share/doc/mat', ['README', 'TODO'] ), 44 ( 'share/doc/mat', ['README', 'TODO'] ),
45 ( 'share/mat/locale/', [i for i in l10n()] ),
31 ], 46 ],
32) 47)