Returns the current content of the document as a string.
(self)
| 85 | self._writes.insert(index, content) |
| 86 | |
| 87 | def getvalue(self): |
| 88 | """ |
| 89 | Returns the current content of the document as a string. |
| 90 | """ |
| 91 | if self.hrefs: |
| 92 | self.style.new_paragraph() |
| 93 | for refname, link in self.hrefs.items(): |
| 94 | self.style.link_target_definition(refname, link) |
| 95 | return ''.join(self._writes).encode('utf-8') |
| 96 | |
| 97 | def translate_words(self, words): |
| 98 | return [self.translation_map.get(w, w) for w in words] |