Just | 7cb6272 | 2000-01-04 14:03:13 +0000 | [diff] [blame^] | 1 | import string |
| 2 | import DefaultTable |
| 3 | |
| 4 | |
| 5 | class asciiTable(DefaultTable.DefaultTable): |
| 6 | |
| 7 | def toXML(self, writer, ttFont): |
| 8 | writer.begintag("source") |
| 9 | writer.newline() |
| 10 | writer.write_noindent(string.replace(self.data, "\r", "\n")) |
| 11 | writer.newline() |
| 12 | writer.endtag("source") |
| 13 | writer.newline() |
| 14 | |
| 15 | def fromXML(self, (name, attrs, content), ttFont): |
| 16 | lines = string.split(string.replace(string.join(content, ""), "\r", "\n"), "\n") |
| 17 | self.data = string.join(lines[1:-1], "\r") |
| 18 | |