setup.py: fix compile_translations command
This commit is contained in:
parent
35edc71e11
commit
df934ed97f
12
setup.py
12
setup.py
|
@ -20,30 +20,28 @@ class compile_translations(Command):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
curdir = os.getcwd()
|
||||||
try:
|
try:
|
||||||
from django.core.management.commands.compilemessages import \
|
from django.core.management import call_command
|
||||||
compile_messages
|
|
||||||
for path, dirs, files in os.walk('src'):
|
for path, dirs, files in os.walk('src'):
|
||||||
if 'locale' not in dirs:
|
if 'locale' not in dirs:
|
||||||
continue
|
continue
|
||||||
curdir = os.getcwd()
|
|
||||||
os.chdir(os.path.realpath(path))
|
os.chdir(os.path.realpath(path))
|
||||||
compile_messages(sys.stderr)
|
call_command('compilemessages')
|
||||||
os.chdir(curdir)
|
os.chdir(curdir)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print
|
print
|
||||||
sys.stderr.write('!!! Please install Django >= 1.4 to build translations')
|
sys.stderr.write('!!! Please install Django >= 1.4 to build translations')
|
||||||
print
|
print
|
||||||
print
|
print
|
||||||
|
os.chdir(curdir)
|
||||||
|
|
||||||
|
|
||||||
class build(_build):
|
|
||||||
sub_commands = [('compile_translations', None)] + _build.sub_commands
|
|
||||||
|
|
||||||
class build(_build):
|
class build(_build):
|
||||||
sub_commands = [('compile_translations', None)] + _build.sub_commands
|
sub_commands = [('compile_translations', None)] + _build.sub_commands
|
||||||
|
|
||||||
class eo_sdist(sdist):
|
class eo_sdist(sdist):
|
||||||
|
sub_commands = [('compile_translations', None)] + _build.sub_commands
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
print "creating VERSION file"
|
print "creating VERSION file"
|
||||||
|
|
Reference in New Issue