From 33f8015835edca9e44a5a38b98e69600d6c5559b Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 31 Aug 2014 13:07:00 +0530 Subject: [PATCH] Make the help module read documentation directory from config --- data/etc/plinth/plinth.config | 3 ++- plinth/cfg.py | 2 ++ plinth/modules/help/help.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data/etc/plinth/plinth.config b/data/etc/plinth/plinth.config index 4cf364501..95d443267 100644 --- a/data/etc/plinth/plinth.config +++ b/data/etc/plinth/plinth.config @@ -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 diff --git a/plinth/cfg.py b/plinth/cfg.py index 3f8b687b5..27c32c1e7 100644 --- a/plinth/cfg.py +++ b/plinth/cfg.py @@ -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'), diff --git a/plinth/modules/help/help.py b/plinth/modules/help/help.py index b3245dc89..4cbe8e893 100644 --- a/plinth/modules/help/help.py +++ b/plinth/modules/help/help.py @@ -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: