From 153d8d446603250085b384fda1a08e6a7267c7d7 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 8 Jan 2012 19:12:03 +0100 Subject: Setup.py now generate locales --- setup.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index bf109e5..7847163 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,9 @@ #!/usr/bin/env python import os +import sys +import glob +import subprocess from distutils.core import setup @@ -12,21 +15,33 @@ from mat import mat if os.path.exists('MANIFEST'): os.remove('MANIFEST') + +def l10n(): + ''' + Compile .po files to .mo + ''' + for language in glob.glob('locale/*'): + fpath = os.path.join(language, 'LC_MESSAGES', 'mat-gui.po') + output = fpath[:-2] + 'mo' + subprocess.call(['msgfmt', fpath, '-o', output]) + yield output + setup( name = 'MAT', version = mat.__version__, description = 'Metadata Anonymisation Toolkit', - long_decription = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir', + long_description = 'A Metadata Anonymisation Toolkit in Python, using python-hachoir', author = mat.__author__, author_email = 'julien.voisin@dustri.org', - platforms = 'linux', + platforms = 'linux', license = 'GPLv2', url = 'https://mat.boum.org', packages = ['mat', 'mat.hachoir_editor', 'mat.bencode', 'mat.tarfile'], scripts = ['mat-cli', 'mat-gui'], data_files = [ - ( 'share/applications', [ 'mat.desktop' ] ), + ( 'share/applications', ['mat.desktop'] ), ( 'share/mat', ['FORMATS'] ), ( 'share/doc/mat', ['README', 'TODO'] ), + ( 'share/mat/locale/', [i for i in l10n()] ), ], ) -- cgit v1.3