From df934ed97f0f87d893930b4e3b60bdea6d998fe2 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 27 Oct 2015 17:40:49 +0100 Subject: [PATCH] setup.py: fix compile_translations command --- setup.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 528bb60..98fdfaf 100755 --- a/setup.py +++ b/setup.py @@ -20,30 +20,28 @@ class compile_translations(Command): pass def run(self): + curdir = os.getcwd() try: - from django.core.management.commands.compilemessages import \ - compile_messages + from django.core.management import call_command for path, dirs, files in os.walk('src'): if 'locale' not in dirs: continue - curdir = os.getcwd() os.chdir(os.path.realpath(path)) - compile_messages(sys.stderr) + call_command('compilemessages') os.chdir(curdir) except ImportError: print sys.stderr.write('!!! Please install Django >= 1.4 to build translations') print print + os.chdir(curdir) -class build(_build): - sub_commands = [('compile_translations', None)] + _build.sub_commands - class build(_build): sub_commands = [('compile_translations', None)] + _build.sub_commands class eo_sdist(sdist): + sub_commands = [('compile_translations', None)] + _build.sub_commands def run(self): print "creating VERSION file"