-class DocumentStorage(object):
- def __init__(self, path):
- self.vstorage = vstorage.VersionedStorage(path)
-
- def get(self, name, revision=None):
- if revision is None:
- text = self.vstorage.page_text(name)
- else:
- text = self.vstorage.revision_text(name, revision)
- return Document(self, name=name, text=text)
-
- def put(self, name, document, author, comment, parent):
- self.vstorage.save_text(document.name, document.text, author, comment, parent)