diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-02-18 23:39:17 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-02-18 23:39:17 +0000 |
commit | 9eb6fd5c65673074f9cc71864674fecabbcc9b5c (patch) | |
tree | 8d7aade89fac11fcea692f819176f078b7a5bfef | |
parent | 3e258cc474810e0e4b0aa74fd5edbce0839b4305 (diff) |
adjust Theme definition
to new names for themespec and default theme
and corrected issue with 1c mode lookups (bg undefined)
-rw-r--r-- | alot/settings.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/alot/settings.py b/alot/settings.py index e86dd80a..8a16eee4 100644 --- a/alot/settings.py +++ b/alot/settings.py @@ -44,15 +44,17 @@ def read_config(configpath=None, specpath=None): class Theme(object): def __init__(self, path): - self._spec = os.path.join(DEFAULTSPATH, 'theme.rc.spec') + self._spec = os.path.join(DEFAULTSPATH, 'theme.spec') self._config = read_config(path, self._spec) + self.path = path def get_attribute(self, mode, name, colourmode): fg = self._config['%dc' % colourmode][mode][name]['fg'] - bg = self._config['%dc' % colourmode][mode][name]['bg'] if colourmode == 1: bg = 'default' - elif colourmode == 256: + else: + bg = self._config['%dc' % colourmode][mode][name]['bg'] + if colourmode == 256: fg = fg or self._config['16c'][mode][name][fg] bg = bg or self._config['16c'][mode][name][bg] return urwid.AttrSpec(fg, bg, colourmode) @@ -66,7 +68,7 @@ class SettingsManager(object): self.read_config(alot_rc) self.read_notmuch_config(notmuch_rc) - theme_path = theme or os.path.join(DEFAULTSPATH, 'theme.rc') + theme_path = theme or os.path.join(DEFAULTSPATH, 'default.theme') self.theme = Theme(theme_path) |