mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
frontpage: Load shortcuts from .d directories too
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
aaa306aef5
commit
4ea2e755db
@ -160,11 +160,15 @@ def _extract_web_app_url(custom_shortcut):
|
||||
|
||||
def get_custom_shortcuts():
|
||||
"""Return a merged dictionary of all custom shortcuts."""
|
||||
shortcuts_dirs = [cfg.config_dir, cfg.data_dir, cfg.file_root]
|
||||
dirs = [cfg.config_dir, cfg.data_dir, cfg.file_root]
|
||||
file_paths = [
|
||||
pathlib.Path(dir_) / 'custom-shortcuts.json' for dir_ in dirs
|
||||
]
|
||||
file_paths = cfg.expand_to_dot_d_paths(file_paths)
|
||||
|
||||
shortcuts = {'shortcuts': []}
|
||||
for shortcuts_dir in shortcuts_dirs:
|
||||
file_path = pathlib.Path(shortcuts_dir) / 'custom-shortcuts.json'
|
||||
for file_path in file_paths:
|
||||
file_path = pathlib.Path(file_path)
|
||||
if not file_path.is_file() or not file_path.stat().st_size:
|
||||
continue
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user