Ignore empty group/color colorscheme translations

This commit is contained in:
Kim Silkebækken 2012-12-13 14:28:09 +01:00
parent 3037b9fbf1
commit eb28d759cc
1 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ class Colorscheme(object):
if not mode in self.modes_groups:
self.modes_groups[mode] = {}
if group_name in translations['groups']:
if group_name in translations.get('groups', {}):
# Override entire group if present in the translations group dict
self.modes_groups[mode][group_name] = {
'fg': self.colors[translations['groups'][group_name]['fg']],
@ -44,8 +44,8 @@ class Colorscheme(object):
else:
# Fallback to color translations from the translations colors dict
self.modes_groups[mode][group_name] = {
'fg': self.colors[translations['colors'].get(group_props['fg'], group_props['fg'])],
'bg': self.colors[translations['colors'].get(group_props['bg'], group_props['bg'])],
'fg': self.colors[translations.get('colors', {}).get(group_props['fg'], group_props['fg'])],
'bg': self.colors[translations.get('colors', {}).get(group_props['bg'], group_props['bg'])],
'attr': group_attr_flag,
}