mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
frontpage: Log a message when loading custom shortcuts
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
063489c036
commit
5caac243a2
@ -17,13 +17,17 @@
|
|||||||
"""
|
"""
|
||||||
Manage application shortcuts on front page.
|
Manage application shortcuts on front page.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from plinth import app, cfg
|
from plinth import app, cfg
|
||||||
|
|
||||||
from . import actions
|
from . import actions
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Shortcut(app.FollowerComponent):
|
class Shortcut(app.FollowerComponent):
|
||||||
"""An application component for handling shortcuts."""
|
"""An application component for handling shortcuts."""
|
||||||
@ -173,6 +177,7 @@ def get_custom_shortcuts():
|
|||||||
cfg_dir = os.path.dirname(cfg.config_file)
|
cfg_dir = os.path.dirname(cfg.config_file)
|
||||||
shortcuts_file = os.path.join(cfg_dir, 'custom-shortcuts.json')
|
shortcuts_file = os.path.join(cfg_dir, 'custom-shortcuts.json')
|
||||||
if os.path.isfile(shortcuts_file) and os.stat(shortcuts_file).st_size:
|
if os.path.isfile(shortcuts_file) and os.stat(shortcuts_file).st_size:
|
||||||
|
logger.info('Loading custom shortcuts from %s', shortcuts_file)
|
||||||
with open(shortcuts_file) as shortcuts:
|
with open(shortcuts_file) as shortcuts:
|
||||||
custom_shortcuts = json.load(shortcuts)
|
custom_shortcuts = json.load(shortcuts)
|
||||||
return custom_shortcuts
|
return custom_shortcuts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user