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
|
||||
|
||||
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"
|
||||
|
|
Reference in New Issue