diff -r 679cddc80874 -r c5df431d7d18 django/bin/make-messages.py
|
a
|
b
|
|
| 81 | 81 | for dirpath, file in all_files: |
| 82 | 82 | if domain == 'djangojs' and file.endswith('.js'): |
| 83 | 83 | if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) |
| 84 | | src = open(os.path.join(dirpath, file), "rb").read() |
| | 84 | src = open(os.path.join(dirpath, file), "rU").read() |
| 85 | 85 | src = pythonize_re.sub('\n#', src) |
| 86 | | open(os.path.join(dirpath, '%s.py' % file), "wb").write(src) |
| | 86 | open(os.path.join(dirpath, '%s.py' % file), "wt").write(src) |
| 87 | 87 | thefile = '%s.py' % file |
| 88 | 88 | cmd = 'xgettext -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % (domain, os.path.join(dirpath, thefile)) |
| 89 | 89 | (stdin, stdout, stderr) = os.popen3(cmd, 't') |
| … |
… |
|
| 107 | 107 | elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')): |
| 108 | 108 | thefile = file |
| 109 | 109 | if file.endswith('.html'): |
| 110 | | src = open(os.path.join(dirpath, file), "rb").read() |
| | 110 | src = open(os.path.join(dirpath, file), "rU").read() |
| 111 | 111 | thefile = '%s.py' % file |
| 112 | | open(os.path.join(dirpath, thefile), "wb").write(templatize(src)) |
| | 112 | open(os.path.join(dirpath, thefile), "wt").write(templatize(src)) |
| 113 | 113 | if verbose: |
| 114 | 114 | sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) |
| 115 | 115 | cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( |