- @with_working_copy_locked
- def open_page(self, title):
- if title not in self:
- raise DocumentNotFound()
-
- path = self._title_to_file(title)
- logger.debug("Opening page %s", path)
+ def page_text(self, title, revision=None):
+ """Read unicode text of a page."""
+ ctx = self._find_filectx(title, revision)
+ return ctx.data().decode(self.charset, 'replace'), ctx.filerev()
+
+ def page_text_by_tag(self, title, tag):
+ """Read unicode text of a taged page."""
+ fname = self._title_to_file(title)
+ tag = u"{fname}#{tag}".format(**locals()).encode('utf-8')
+