summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-01-03 17:00:41 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-01-03 17:00:41 +0000
commit7fe9f5fdf3981824e1260665fec82423f275074b (patch)
tree029addf6d6f580b205ed27f96c3ad6aa849e9492
parent50f65c540ce3c02b5b0cff94fd357f5a804495ab (diff)
pep8
-rw-r--r--alot/buffers.py3
-rw-r--r--alot/helper.py1
-rwxr-xr-xalot/init.py1
-rw-r--r--alot/settings.py21
-rw-r--r--alot/widgets.py12
5 files changed, 22 insertions, 16 deletions
diff --git a/alot/buffers.py b/alot/buffers.py
index f25b8594..58a03213 100644
--- a/alot/buffers.py
+++ b/alot/buffers.py
@@ -323,7 +323,8 @@ class TagListBuffer(Buffer):
self.isinitialized = True
lines = list()
- displayedtags = sorted(filter(self.filtfun, self.tags), key=unicode.lower)
+ displayedtags = sorted(filter(self.filtfun, self.tags),
+ key=unicode.lower)
for (num, b) in enumerate(displayedtags):
tw = widgets.TagWidget(b)
lines.append(urwid.Columns([('fixed', tw.width(), tw)]))
diff --git a/alot/helper.py b/alot/helper.py
index 177cd66e..19976a4c 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -272,6 +272,7 @@ def guess_encoding(blob):
return m.buffer(blob)
+# TODO: make this work on blobs, not paths
def mimewrap(path, filename=None, ctype=None):
content = open(path, 'rb').read()
ctype = ctype or guess_mimetype(content)
diff --git a/alot/init.py b/alot/init.py
index 92dde11c..5ce1d586 100755
--- a/alot/init.py
+++ b/alot/init.py
@@ -49,6 +49,7 @@ class ComposeOptions(SubcommandOptions):
class SearchOptions(SubcommandOptions):
accepted = ['oldest_first', 'newest_first', 'message_id', 'unsorted']
+
def colourint(val):
if val not in accepted:
raise ValueError("Unknown sort order")
diff --git a/alot/settings.py b/alot/settings.py
index c4cd93f3..72d5a7a1 100644
--- a/alot/settings.py
+++ b/alot/settings.py
@@ -110,21 +110,22 @@ class AlotConfigParser(FallbackConfigParser):
def _get_themeing_option(self, section, option, default='default'):
"""
- Retrieve the value of the given option from the given section of the config
- file.
-
- If the option does not exist, try its parent options before falling back to
- the specified default. The parent of an option is the name of the option
- itself minus the last section enclosed in underscores; so the parent of the
- option `aaa_bbb_ccc_fg` is of the form `aaa_bbb_fg`.
-
+ Retrieve the value of the given option from the given section of the
+ config file.
+
+ If the option does not exist, try its parent options before falling
+ back to the specified default. The parent of an option is the name of
+ the option itself minus the last section enclosed in underscores;
+ so the parent of the option `aaa_bbb_ccc_fg` is of the form
+ `aaa_bbb_fg`.
+
:param section: the section of the config file to search for the given
option
:type section: string
:param option: the option to lookup
:type option: string
- :param default: the value that is to be returned if neither the requested
- option nor a parent exists
+ :param default: the value that is to be returned if neither the
+ requested option nor a parent exists
:type default: string
:return: the value of the given option, or the specified default
:rtype: string
diff --git a/alot/widgets.py b/alot/widgets.py
index 6cdafb62..9a024afa 100644
--- a/alot/widgets.py
+++ b/alot/widgets.py
@@ -77,7 +77,8 @@ class ThreadlineWidget(urwid.AttrMap):
self.tag_widgets = []
self.display_content = config.getboolean('general',
'display_content_in_threadline')
- self.highlight_components = config.getstringlist('general', 'thread_highlight_components')
+ self.highlight_components = config.getstringlist('general',
+ 'thread_highlight_components')
self.highlight_tags = config.get_highlight_tags()
self.rebuild()
urwid.AttrMap.__init__(self, self.columns,
@@ -162,8 +163,10 @@ class ThreadlineWidget(urwid.AttrMap):
self._get_theme('mailcount', focus)})
for tw in self.tag_widgets:
tw.set_focussed()
- self.authors_w.set_attr_map({None: self._get_theme('authors', focus)})
- self.subject_w.set_attr_map({None: self._get_theme('subject', focus)})
+ self.authors_w.set_attr_map({None: self._get_theme('authors',
+ focus)})
+ self.subject_w.set_attr_map({None: self._get_theme('subject',
+ focus)})
if self.display_content:
self.content_w.set_attr_map(
{None: 'search_thread_content_focus'})
@@ -202,7 +205,7 @@ class ThreadlineWidget(urwid.AttrMap):
if self.highlight_theme_suffix and component in self.highlight_components:
tag_theme = theme + '_{tags}'.format(tags=self.highlight_theme_suffix)
if config.has_themeing(tag_theme):
- theme = tag_theme
+ theme = tag_theme
return theme
@@ -427,7 +430,6 @@ class MessageWidget(urwid.WidgetWrap):
self.pile = urwid.Pile(self.displayed_list)
self._w = self.pile
-
def _build_sum_line(self):
"""creates/returns the widget that displays the summary line."""
self.sumw = MessageSummaryWidget(self.message, even=self.even)