Ejemplo n.º 1
0
 def test_escaping_newline_tabs(self):
     """test that we handle all kinds of newline permutations"""
     dtdsource = '<!ENTITY  noupdatesfound.intro "A hard coded newline.\\nAnd tab\\t and a \\r carriage return.">\n'
     converter = dtd2po.dtd2po()
     thedtd = dtd.dtdunit()
     thedtd.parse(dtdsource)
     thepo = po.pounit()
     converter.convertstrings(thedtd, thepo)
     print(thedtd)
     print(thepo.source)
     # \n in a dtd should also appear as \n in the PO file
     assert thepo.source == r"A hard coded newline.\nAnd tab\t and a \r carriage return."
Ejemplo n.º 2
0
 def test_escaping_newline_tabs(self):
     """test that we handle all kinds of newline permutations"""
     dtdsource = '<!ENTITY  noupdatesfound.intro "A hard coded newline.\\nAnd tab\\t and a \\r carriage return.">\n'
     converter = dtd2po.dtd2po()
     thedtd = dtd.dtdunit()
     thedtd.parse(dtdsource)
     thepo = po.pounit()
     converter.convertstrings(thedtd, thepo)
     print(thedtd)
     print(thepo.source)
     # \n in a dtd should also appear as \n in the PO file
     assert thepo.source == r"A hard coded newline.\nAnd tab\t and a \r carriage return."
Ejemplo n.º 3
0
 def convertunit(self, inputunit):
     dtdunit = dtd.dtdunit()
     self.convertcomments(inputunit, dtdunit)
     self.convertstrings(inputunit, dtdunit)
     return dtdunit
Ejemplo n.º 4
0
 def convertunit(self, inputunit):
     dtdunit = dtd.dtdunit()
     self.convertcomments(inputunit, dtdunit)
     self.convertstrings(inputunit, dtdunit)
     return dtdunit