class DocumentStorage(object):
def __init__(self, path):
self.vstorage = vstorage.VersionedStorage(path)
class DocumentStorage(object):
def __init__(self, path):
self.vstorage = vstorage.VersionedStorage(path)
if revision is None:
text = self.vstorage.page_text(name)
else:
text = self.vstorage.revision_text(name, revision)
if revision is None:
text = self.vstorage.page_text(name)
else:
text = self.vstorage.revision_text(name, revision)
def put(self, document, author, comment, parent):
self.vstorage.save_text(document.name, document.text, author, comment, parent)
def put(self, document, author, comment, parent):
self.vstorage.save_text(document.name, document.text, author, comment, parent)
def __init__(self, storage, **kwargs):
self.storage = storage
for attr, value in kwargs.iteritems():
setattr(self, attr, value)
def __init__(self, storage, **kwargs):
self.storage = storage
for attr, value in kwargs.iteritems():
setattr(self, attr, value)
def plain_text(self):
return re.sub(self.META_REGEX, '', self.text, 1)
def plain_text(self):
return re.sub(self.META_REGEX, '', self.text, 1)
m = re.match(self.META_REGEX, self.text)
if m:
for line in m.group(1).split('\n'):
m = re.match(self.META_REGEX, self.text)
if m:
for line in m.group(1).split('\n'):