realms-wiki/reimagine/wiki.py

26 lines
614 B
Python
Raw Normal View History

from gittle import Gittle
import os
2013-09-29 00:33:00 +03:00
class Wiki():
path = None
base_path = '/'
default_ref = 'master'
default_committer_name = 'Anon'
default_committer_email = 'anon@anon.anon'
index_page = 'Home'
2013-09-29 00:33:00 +03:00
repo = None
def __init__(self, path, **kwargs):
self.path = path
2013-09-29 00:33:00 +03:00
self.repo = Gittle(path)
def write_page(self, name):
name = name.replace(" ", "-")
def rename_page(self, page, rename, commit={}):
pass
2013-09-29 00:33:00 +03:00
def get_page(self, name):
name = name.lower() + ".md"
return self.repo.get_commit_files('HEAD', paths=[name]).get(name)