diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2011-12-10 20:01:49 +0000 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2011-12-10 20:01:49 +0000 |
commit | b47e67fa180222403f9bbfb46ce8926a28b70f32 (patch) | |
tree | 252010c43e52ead33eaa6baef43cc675a47d6634 /alot/buffers.py | |
parent | c3d135ecfef90d5c23af6a20173fabd44ced24ce (diff) |
include mode string in Buffer.__str__
before, __str__ returned a mode identifier or additional info for the buffer. Now the
modestring is always included and is not artificially prepended for the buffers that only
yield additional info.
issue #143
Diffstat (limited to 'alot/buffers.py')
-rw-r--r-- | alot/buffers.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/alot/buffers.py b/alot/buffers.py index 2c49ed7c..749ce274 100644 --- a/alot/buffers.py +++ b/alot/buffers.py @@ -16,9 +16,7 @@ class Buffer(object): self.body = widget def __str__(self): - # TODO rename this: its used to display this buffer - # in the buffer list and gets displayed in the footer - return self.typename + return '[%s]' % self.typename def render(self, size, focus=False): return self.body.render(size, focus) @@ -100,7 +98,7 @@ class EnvelopeBuffer(Buffer): def __str__(self): to = self.envelope.get('To', fallback='unset') - return "to: %s" % shorten_author_string(to, 400) + return '[%s] to: %s' % (self.typename, shorten_author_string(to, 400)) def get_email(self): """returns message represented as :class:`email.Message`""" @@ -162,7 +160,8 @@ class SearchBuffer(Buffer): Buffer.__init__(self, ui, self.body, 'search') def __str__(self): - return '%s (%d threads)' % (self.querystring, self.result_count) + formatstring = '[search] for "%s" (%d threads)' + return formatstring % (self.querystring, self.result_count) def cleanup(self): self.kill_filler_process() @@ -234,7 +233,7 @@ class ThreadBuffer(Buffer): Buffer.__init__(self, ui, self.body, 'thread') def __str__(self): - return '%s, (%d)' % (self.thread.get_subject(), self.message_count) + return '[thread] %s, (%d)' % (self.thread.get_subject(), self.message_count) def get_selected_thread(self): """returns the displayed :class:`~alot.db.Thread`""" |