realms-wiki/reimagine/wiki.py
2013-09-28 16:33:00 -05:00

26 lines
614 B
Python

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