use application factory, WIP
This commit is contained in:
parent
e6bc4928c9
commit
38e5ef85c0
17 changed files with 200 additions and 120 deletions
|
@ -1,13 +1,14 @@
|
|||
import os
|
||||
import sys
|
||||
from realms import app
|
||||
from realms.modules.wiki.models import Wiki
|
||||
|
||||
# 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_)
|
||||
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_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue