Remove use of python_root in cfg and use relative path

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

View File

@ -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'),

View File

@ -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