Make the help module read documentation directory from config

This commit is contained in:
Sunil Mohan Adapa 2014-08-31 13:07:00 +05:30
parent 5ed58d6632
commit 33f8015835
3 changed files with 5 additions and 2 deletions

View File

@ -8,8 +8,9 @@ file_root = /usr/share/plinth/static
data_dir = /var/lib/plinth
log_dir = /var/log/plinth
pid_dir = /var/run
actions_dir = /usr/share/plinth/actions
server_dir = plinth/
actions_dir = /usr/share/plinth/actions
doc_dir = /usr/share/doc/plinth
# file locations
store_file = %(data_dir)s/store.sqlite3

View File

@ -13,6 +13,7 @@ data_dir = None
store_file = None
user_db = None
actions_dir = None
doc_dir = None
status_log_file = None
access_log_file = None
pidfile = None
@ -44,6 +45,7 @@ def read():
('Path', 'store_file'),
('Path', 'user_db'),
('Path', 'actions_dir'),
('Path', 'doc_dir'),
('Path', 'status_log_file'),
('Path', 'access_log_file'),
('Path', 'pidfile'),

View File

@ -36,7 +36,7 @@ def about(request):
def helppage(request, page):
"""Serve a help page from the 'doc' directory"""
try:
with open(os.path.join('doc', '%s.part.html' % page), 'r') \
with open(os.path.join(cfg.doc_dir, '%s.part.html' % page), 'r') \
as input_file:
main = input_file.read()
except IOError: