Changed unique-messages.py, compile-messages.py and make-messages.py to use 'if name == main' so they can be imported and won't mess up utilities such as pychecker

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2056 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-01-19 00:54:15 +00:00
parent 2e0fc1ff95
commit ce40c4a9e2
3 changed files with 145 additions and 137 deletions

View File

@ -4,6 +4,7 @@ import os
import sys
import getopt
def compile_messages():
basedir = None
if os.path.isdir(os.path.join('conf', 'locale')):
@ -22,3 +23,5 @@ for (dirpath, dirnames, filenames) in os.walk(basedir):
cmd = 'msgfmt -o "%s.mo" "%s.po"' % (pf, pf)
os.system(cmd)
if __name__ == "__main__":
compile_messages()

View File

@ -1,14 +1,14 @@
#!/usr/bin/python
from django.utils.translation import templateize
import re
import os
import sys
import getopt
from django.utils.translation import templateize
pythonize_re = re.compile(r'\n\s*//')
def make_messages():
localedir = None
if os.path.isdir(os.path.join('conf', 'locale')):
@ -137,3 +137,5 @@ for lang in languages:
open(pofile, 'wb').write(msgs)
os.unlink(potfile)
if __name__ == "__main__":
make_messages()

View File

@ -4,6 +4,7 @@ import os
import sys
import getopt
def unique_messages():
basedir = None
if os.path.isdir(os.path.join('conf', 'locale')):
@ -24,3 +25,5 @@ for (dirpath, dirnames, filenames) in os.walk(basedir):
msg = stdout.read()
open('%s.po' % pf, 'w').write(msg)
if __name__ == "__main__":
unique_messages()