2016-08-20 01:48:00 +03:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2014-10-21 01:27:38 +03:00
|
|
|
import os
|
|
|
|
import sys
|
2016-08-20 01:48:00 +03:00
|
|
|
|
|
|
|
from .models import Wiki
|
2014-10-21 01:27:38 +03:00
|
|
|
|
|
|
|
|
2014-10-22 00:06:27 +03:00
|
|
|
def init(app):
|
|
|
|
# Init Wiki
|
|
|
|
Wiki(app.config['WIKI_PATH'])
|
|
|
|
|
|
|
|
# Check paths
|
|
|
|
for mode in [os.W_OK, os.R_OK]:
|
|
|
|
for dir_ in [app.config['WIKI_PATH'], os.path.join(app.config['WIKI_PATH'], '.git')]:
|
|
|
|
if not os.access(dir_, mode):
|
|
|
|
sys.exit('Read and write access to WIKI_PATH is required (%s)' % dir_)
|