From 884bbd3f29454898032754c4b532c58518365eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Wed, 16 Jan 2013 08:47:49 +0100 Subject: [PATCH] Make mode_translations optional in colorschemes --- powerline/colorscheme.py | 2 +- powerline/colorschemes/terminal/default.json | 3 +-- powerline/colorschemes/tmux/default.json | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/powerline/colorscheme.py b/powerline/colorscheme.py index e03d738d..89330603 100644 --- a/powerline/colorscheme.py +++ b/powerline/colorscheme.py @@ -26,7 +26,7 @@ class Colorscheme(object): } # Create mode-specific highlighting for this group - for mode, translations in colorscheme['mode_translations'].items(): + for mode, translations in colorscheme.get('mode_translations', {}).items(): if not mode in self.modes_groups: self.modes_groups[mode] = {} if group_name in translations.get('groups', {}): diff --git a/powerline/colorschemes/terminal/default.json b/powerline/colorschemes/terminal/default.json index f0436ae0..5d4ccc2e 100644 --- a/powerline/colorschemes/terminal/default.json +++ b/powerline/colorschemes/terminal/default.json @@ -58,6 +58,5 @@ "branch": { "fg": "gray9", "bg": "gray4" }, "cwd": { "fg": "gray10", "bg": "gray4" }, "hostname": { "fg": "brightyellow", "bg": "mediumorange" } - }, - "mode_translations": { } + } } diff --git a/powerline/colorschemes/tmux/default.json b/powerline/colorschemes/tmux/default.json index 20ea2ce0..42bb6281 100644 --- a/powerline/colorschemes/tmux/default.json +++ b/powerline/colorschemes/tmux/default.json @@ -24,6 +24,5 @@ "system_load_bad": { "fg": "yellow", "bg": "darkestblue" }, "system_load_ugly": { "fg": "red", "bg": "darkestblue" }, "uptime": { "fg": "brightblue", "bg": "darkestblue" } - }, - "mode_translations": { } + } }