mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Remove use of python_root in cfg and use relative path
This commit is contained in:
parent
33f8015835
commit
b82fb629f0
@ -8,7 +8,6 @@ product_name = None
|
|||||||
box_name = None
|
box_name = None
|
||||||
root = None
|
root = None
|
||||||
file_root = None
|
file_root = None
|
||||||
python_root = None
|
|
||||||
data_dir = None
|
data_dir = None
|
||||||
store_file = None
|
store_file = None
|
||||||
user_db = None
|
user_db = None
|
||||||
@ -40,7 +39,6 @@ def read():
|
|||||||
('Name', 'box_name'),
|
('Name', 'box_name'),
|
||||||
('Path', 'root'),
|
('Path', 'root'),
|
||||||
('Path', 'file_root'),
|
('Path', 'file_root'),
|
||||||
('Path', 'python_root'),
|
|
||||||
('Path', 'data_dir'),
|
('Path', 'data_dir'),
|
||||||
('Path', 'store_file'),
|
('Path', 'store_file'),
|
||||||
('Path', 'user_db'),
|
('Path', 'user_db'),
|
||||||
|
|||||||
@ -73,6 +73,7 @@ def get_status():
|
|||||||
|
|
||||||
def _apply_changes(request, old_status, new_status):
|
def _apply_changes(request, old_status, new_status):
|
||||||
"""Apply form changes"""
|
"""Apply form changes"""
|
||||||
|
root = os.path.join(os.path.dirname(__file__), '..', '..')
|
||||||
for field, enabled in new_status.items():
|
for field, enabled in new_status.items():
|
||||||
if not field.endswith('_enabled'):
|
if not field.endswith('_enabled'):
|
||||||
continue
|
continue
|
||||||
@ -83,8 +84,8 @@ def _apply_changes(request, old_status, new_status):
|
|||||||
module = field.split('_enabled')[0]
|
module = field.split('_enabled')[0]
|
||||||
if enabled:
|
if enabled:
|
||||||
try:
|
try:
|
||||||
actions.superuser_run(
|
actions.superuser_run('module-manager',
|
||||||
'module-manager', ['enable', cfg.python_root, module])
|
['enable', root, module])
|
||||||
except Exception:
|
except Exception:
|
||||||
# TODO: need to get plinth to load the module we just
|
# TODO: need to get plinth to load the module we just
|
||||||
# enabled
|
# enabled
|
||||||
@ -97,8 +98,8 @@ def _apply_changes(request, old_status, new_status):
|
|||||||
module=module))
|
module=module))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
actions.superuser_run(
|
actions.superuser_run('module-manager',
|
||||||
'module-manager', ['disable', cfg.python_root, module])
|
['disable', root, module])
|
||||||
except Exception:
|
except Exception:
|
||||||
# TODO: need a smoother way for plinth to unload the
|
# TODO: need a smoother way for plinth to unload the
|
||||||
# module
|
# module
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user