25
26
string literals are concatenated together. We cater to that by making each
26
27
line into a "-delimited line with the newline encoded into the string.
29
>>> f = StringIO(); grd_msg_write_in_po("asdf", "12<ph name=\"AB\" />3\n4<ph name=\"C\"/>56", f).getvalue()
34
logging.warn("Text from GRD, %r, looks like it has percent-openbrace already, which would be confusing later.", text)
31
37
outfile.write('{0} ""\n'.format(header))
32
38
outfile.write('"' + '\\n"\n"'.join(line.replace("\\", "\\\\") for line in text.split("\n")) + '"\n')