diff options
| author | tkikuchi | 2006-04-30 07:40:11 +0000 |
|---|---|---|
| committer | tkikuchi | 2006-04-30 07:40:11 +0000 |
| commit | 9ae82f141628def028b6b85b71dc8a774154af7d (patch) | |
| tree | 795c62851224da269f04b09f51e3154d267ac36d /bin/po2templ.py | |
| parent | 234dbb8b2ac15fa5b97c8b2d323ef612277e2204 (diff) | |
| download | mailman-9ae82f141628def028b6b85b71dc8a774154af7d.tar.gz mailman-9ae82f141628def028b6b85b71dc8a774154af7d.tar.zst mailman-9ae82f141628def028b6b85b71dc8a774154af7d.zip | |
Diffstat (limited to 'bin/po2templ.py')
| -rwxr-xr-x | bin/po2templ.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/po2templ.py b/bin/po2templ.py index 78e9fc87b..9fb76ec6d 100755 --- a/bin/po2templ.py +++ b/bin/po2templ.py @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 2005 by the Free Software Foundation, Inc. +# Copyright (C) 2005-6 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -27,8 +27,11 @@ Extract templates from language po file. Usage: po2templ.py languages """ +import re import sys +cre = re.compile('^#:\s*templates/en/(?P<filename>.*?):1') + def do_lang(lang): @@ -38,10 +41,11 @@ def do_lang(lang): fp = file('messages/%s/LC_MESSAGES/mailman.po' % lang) try: for line in fp: - if line.startswith('#: templates'): + m = cre.search(line) + if m: in_template = True in_msg = False - filename = line[16:-3] + filename = m.group('filename') outfilename = 'templates/%s/%s' % (lang, filename) continue if in_template and line.startswith('#,'): |
