Update of /cvsroot/mailman/mailman/bin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25572/bin
Modified Files:
po2templ.py templ2pot.py
Log Message:
templ2po.py normalization of '\r\n' to '\n'.
templ2pot.py ... associated change.
templ2po.py ... bug fix.
Index: po2templ.py
===================================================================
RCS file: /cvsroot/mailman/mailman/bin/po2templ.py,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -d -r2.3 -r2.4
--- po2templ.py 30 Dec 2005 18:51:17 -0000 2.3
+++ po2templ.py 8 Jan 2006 08:18:15 -0000 2.4
@@ -45,6 +45,8 @@
outfilename = 'templates/%s/%s' % (lang, filename)
continue
if in_template and line.startswith('#,'):
+ if line.strip() == '#, fuzzy':
+ in_template = False
continue
if in_template and line.startswith('msgstr'):
line = line[7:]
@@ -54,23 +56,25 @@
in_template = False
in_msg = False
if len(msgstr) > 1 and outfilename:
- # exclude no translation ... only one LF.
+ # exclude no translation ... 1 is for LF only
outfile = file(outfilename, 'w')
try:
outfile.write(msgstr)
+ outfile.write('\n')
finally:
outfile.close()
outfilename = ''
msgstr = ''
continue
- msgstr += eval(i)
+ msgstr += eval(line)
finally:
fp.close()
- if msgstr > 1 and outfilename:
- # flush remaining msgstr
+ if len(msgstr) > 1 and outfilename:
+ # flush remaining msgstr (last template file)
outfile = file(outfilename, 'w')
try:
outfile.write(msgstr)
+ outfile.write('\n')
finally:
outfile.close()
Index: templ2pot.py
===================================================================
RCS file: /cvsroot/mailman/mailman/bin/templ2pot.py,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -d -r2.2 -r2.3
--- templ2pot.py 30 Dec 2005 18:52:00 -0000 2.2
+++ templ2pot.py 8 Jan 2006 08:18:15 -0000 2.3
@@ -74,7 +74,7 @@
def normalize(s):
# This converts the various Python string types into a format that is
# appropriate for .po files, namely much closer to C style.
- lines = s.split('\n')
+ lines = s.splitlines()
if len(lines) == 1:
s = '"' + escape(s) + '"'
else:
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org