Logged In: NO
Code review....
1.
You have a few lines like :
s = '%s' % ' '.join(newlines)
Surely that is the same as just:
s = ' '.join(newlines)
2.
You use the single line option value as part of the key in __messages
dictionary. That means that the output will have duplicate msgid values
if your source contains both _normal('hello world') and _single('hello
world'). Other GNU gettext tools assume that there will not be
duplicates.
(assuming --keyword=_normal --keyword-single=_single)
3.
You also get duplicates for:
_single("""this is one line
and this is another""")
and
_single("""this is one line and
this is another""")
because normalization is performed just before output. Unless Im
missing something, I think the right solution to these two problems is
to normalize before calling __addentry, and leave the key to
__messages as it was originally.
|