diff options
author | dtk <dtk@gmx.de> | 2012-01-28 17:48:12 +0100 |
---|---|---|
committer | dtk <dtk@gmx.de> | 2012-01-28 17:48:12 +0100 |
commit | 24e4bbe592213e90d76d37cc703d34a93edbbda1 (patch) | |
tree | 59d3ad61a62b1086b12049a5f0d81e55b05d7c92 | |
parent | 1a3f0f8aec9d843da98e527083f1dff8e4ed0b18 (diff) |
Remove duplicate `has_themeing()` method
Adjust calls to address remaining `has_theming()` method.
Conflicts:
alot/settings.py
-rw-r--r-- | alot/settings.py | 30 | ||||
-rw-r--r-- | alot/widgets.py | 2 |
2 files changed, 8 insertions, 24 deletions
diff --git a/alot/settings.py b/alot/settings.py index 9ac567ea..78dd12d7 100644 --- a/alot/settings.py +++ b/alot/settings.py @@ -158,22 +158,6 @@ class AlotConfigParser(FallbackConfigParser): result = default return result - def has_themeing(self, themeing): - """ - Return true if the given themeing option exists in the current colour - theme. - - :param themeing: The themeing option to check for - :type theming: string - :return: True if themeing exist, False otherwise - :rtype: bool - """ - mode = self.getint('general', 'colourmode') - theme = '{colours}c-theme'.format(colours=mode) - has_fg = self.has_option(theme, themeing + '_fg') - has_bg = self.has_option(theme, themeing + '_bg') - return (has_fg or has_bg) - def _parse_highlighting_rules(self): """ Parse the highlighting rules from the config file. @@ -214,7 +198,7 @@ class AlotConfigParser(FallbackConfigParser): themes = self._select_tag_themes(tag, focus, highlight) selected_theme = themes[-1] for theme in themes: - if self.has_themeing(theme): + if self.has_theming(theme): selected_theme = theme break return selected_theme @@ -243,20 +227,20 @@ class AlotConfigParser(FallbackConfigParser): themes.reverse() return themes - def has_theming(self, themeing): + def has_theming(self, theming): """ - Return true if the given themeing option exists in the current colour + Return true if the given theming option exists in the current colour theme. - :param themeing: The themeing option to check for + :param theming: The theming option to check for :type theming: string - :return: True if themeing exist, False otherwise + :return: True if theming exist, False otherwise :rtype: bool """ mode = self.getint('general', 'colourmode') theme = '{colours}c-theme'.format(colours=mode) - has_fg = self.has_option(theme, themeing + '_fg') - has_bg = self.has_option(theme, themeing + '_bg') + has_fg = self.has_option(theme, theming + '_fg') + has_bg = self.has_option(theme, theming + '_bg') return (has_fg or has_bg) def get_mapping(self, mode, key): diff --git a/alot/widgets.py b/alot/widgets.py index 164643c6..a85e31e8 100644 --- a/alot/widgets.py +++ b/alot/widgets.py @@ -209,7 +209,7 @@ class ThreadlineWidget(urwid.AttrMap): if focus: theme += '_focus' highlight_theme += '_focus' - if config.has_themeing(highlight_theme): + if config.has_theming(highlight_theme): theme = highlight_theme elif focus: theme = theme + '_focus' |