2013-09-29 00:09:02 +03:00
|
|
|
from gittle import Gittle
|
|
|
|
import os
|
|
|
|
|
2013-09-29 00:33:00 +03:00
|
|
|
|
2013-09-29 00:09:02 +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
|
2013-09-29 00:09:02 +03:00
|
|
|
|
|
|
|
def __init__(self, path, **kwargs):
|
|
|
|
self.path = path
|
2013-09-29 00:33:00 +03:00
|
|
|
self.repo = Gittle(path)
|
2013-09-29 00:09:02 +03:00
|
|
|
|
|
|
|
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)
|