diff options
author | pazz <patricktotzke@gmail.com> | 2011-07-31 20:57:04 +0100 |
---|---|---|
committer | pazz <patricktotzke@gmail.com> | 2011-07-31 20:57:04 +0100 |
commit | b3751beaa62541a24a336e020c182bdce0ab12c8 (patch) | |
tree | f236a153117737616b7c4ca70f3aabb4d653319a /alot/command.py | |
parent | f31d177f5b9611c6b9c3f1d1b174c3471d410959 (diff) |
make use of error-notifications
Diffstat (limited to 'alot/command.py')
-rw-r--r-- | alot/command.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/alot/command.py b/alot/command.py index 17edadc3..87fcf6ce 100644 --- a/alot/command.py +++ b/alot/command.py @@ -315,7 +315,7 @@ class ToggleThreadTagCommand(Command): else: self.thread.add_tags([self.tag]) except DatabaseROError: - ui.notify('index in read only mode') + ui.notify('index in read-only mode', priority='error') return # flush index @@ -384,6 +384,7 @@ class ComposeCommand(Command): ui.apply_command(EnvelopeEditCommand(mail=self.mail)) + # SEARCH class RetagPromptCommand(Command): """start a commandprompt to retag selected threads' tags""" @@ -409,7 +410,7 @@ class RetagCommand(Command): try: thread.set_tags(tags) except DatabaseROError, e: - ui.notify('index in read-only mode') + ui.notify('index in read-only mode', priority='error') return # flush index @@ -446,6 +447,7 @@ class RefinePromptCommand(Command): oldquery = sbuffer.querystring ui.commandprompt('refine ' + oldquery) + # THREAD class ReplyCommand(Command): def __init__(self, groupreply=False, **kwargs): @@ -547,7 +549,8 @@ class ForwardCommand(Command): Charset.add_charset('utf-8', Charset.QP, Charset.QP, 'utf-8') if self.inline: # inline mode # set body text - mailcontent = '\nForwarded message from %s:\n' % msg.get_author()[0] + author = msg.get_author()[0] + mailcontent = '\nForwarded message from %s:\n' % author for line in msg.accumulate_body().splitlines(): mailcontent += '>' + line + '\n' @@ -558,7 +561,7 @@ class ForwardCommand(Command): # create empty text msg bodypart = MIMEText('', 'plain', 'UTF-8') reply.attach(bodypart) - # attach original msg + # attach original msg reply.attach(mail) # copy subject @@ -703,9 +706,10 @@ class EnvelopeSendCommand(Command): ui.apply_command(cmd) ui.notify('mail send successful') else: - ui.notify('failed to send: %s' % reason) + ui.notify('failed to send: %s' % reason, priority='error') else: - ui.notify('failed to send: no account set up for %s' % saddr) + ui.notify('failed to send: no account set up for %s' % saddr, + priority='error') # TAGLIST @@ -810,7 +814,8 @@ ALLOWED_COMMANDS = { 'envelope': ['send', 'reedit', 'to', 'subject'] + globalcomands, 'bufferlist': ['openfocussed', 'closefocussed'] + globalcomands, 'taglist': ['select'] + globalcomands, - 'thread': ['toggletag', 'reply', 'groupreply', 'bounce', 'forward'] + globalcomands, + 'thread': globalcommands + ['toggletag', 'reply', 'groupreply', 'bounce', + 'forward'], } |