mirror of
https://github.com/django/django.git
synced 2025-04-25 17:54:37 +00:00
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:
parent
2e0fc1ff95
commit
ce40c4a9e2
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user