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:
Sunil Mohan Adapa authored and James Valleroy committed 2019-08-11 07:46:09 -04:00
1 parent 063489c036
commit 5caac243a2
1 file changed
+5
+5
View File
@@ -17,13 +17,17 @@
"""
Manage application shortcuts on front page.
"""
import json
import logging
import os
from plinth import app, cfg
from . import actions
logger = logging.getLogger(__name__)
class Shortcut(app.FollowerComponent):
"""An application component for handling shortcuts."""
@@ -173,6 +177,7 @@ def get_custom_shortcuts():
cfg_dir = os.path.dirname(cfg.config_file)
shortcuts_file = os.path.join(cfg_dir, 'custom-shortcuts.json')
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:
custom_shortcuts = json.load(shortcuts)
return custom_shortcuts