From b82fb629f074548786e9068bcd864b7a47812fc5 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 31 Aug 2014 13:08:45 +0530 Subject: [PATCH] Remove use of python_root in cfg and use relative path --- plinth/cfg.py | 2 -- plinth/modules/packages/packages.py | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/plinth/cfg.py b/plinth/cfg.py index 27c32c1e7..62263804a 100644 --- a/plinth/cfg.py +++ b/plinth/cfg.py @@ -8,7 +8,6 @@ product_name = None box_name = None root = None file_root = None -python_root = None data_dir = None store_file = None user_db = None @@ -40,7 +39,6 @@ def read(): ('Name', 'box_name'), ('Path', 'root'), ('Path', 'file_root'), - ('Path', 'python_root'), ('Path', 'data_dir'), ('Path', 'store_file'), ('Path', 'user_db'), diff --git a/plinth/modules/packages/packages.py b/plinth/modules/packages/packages.py index 8fe4cf6dc..b6c7a78c9 100644 --- a/plinth/modules/packages/packages.py +++ b/plinth/modules/packages/packages.py @@ -73,6 +73,7 @@ def get_status(): def _apply_changes(request, old_status, new_status): """Apply form changes""" + root = os.path.join(os.path.dirname(__file__), '..', '..') for field, enabled in new_status.items(): if not field.endswith('_enabled'): continue @@ -83,8 +84,8 @@ def _apply_changes(request, old_status, new_status): module = field.split('_enabled')[0] if enabled: try: - actions.superuser_run( - 'module-manager', ['enable', cfg.python_root, module]) + actions.superuser_run('module-manager', + ['enable', root, module]) except Exception: # TODO: need to get plinth to load the module we just # enabled @@ -97,8 +98,8 @@ def _apply_changes(request, old_status, new_status): module=module)) else: try: - actions.superuser_run( - 'module-manager', ['disable', cfg.python_root, module]) + actions.superuser_run('module-manager', + ['disable', root, module]) except Exception: # TODO: need a smoother way for plinth to unload the # module