From 2c57b043cd706f147ab25e3216afbccc358c9318 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 17 Jan 2016 15:40:10 +0530 Subject: [PATCH] implement api.resetUI, fixes #176 --- oml/user/api.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/oml/user/api.py b/oml/user/api.py index dc8790e..4578a24 100644 --- a/oml/user/api.py +++ b/oml/user/api.py @@ -69,6 +69,17 @@ def setPreferences(data): return settings.preferences actions.register(setPreferences) +def resetUI(data): + ''' + takes { + } + ''' + ui_json = os.path.join(settings.config_path, 'ui.json') + if os.path.exists(ui_json): + os.unlink(ui_json) + settings.ui = settings.pdict(ui_json, settings.config['user']['ui']) + return settings.ui +actions.register(resetUI) def setUI(data): '''