summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorpazz <patricktotzke@gmail.com>2011-08-13 14:20:32 +0100
committerpazz <patricktotzke@gmail.com>2011-08-13 14:20:32 +0100
commit69c629825210eb08252a50a7752dfbba517bda75 (patch)
tree36d29130c0afb5f96dcd2f3ff3d4b16e76eed53f /alot
parent235d827db02ea5def93aeccd22d292951846626e (diff)
call shutdown directly in command
Diffstat (limited to 'alot')
-rw-r--r--alot/command.py7
-rw-r--r--alot/ui.py6
2 files changed, 4 insertions, 9 deletions
diff --git a/alot/command.py b/alot/command.py
index 35b1359b..b17e5969 100644
--- a/alot/command.py
+++ b/alot/command.py
@@ -35,6 +35,7 @@ from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
+import urwid
import buffer
import settings
@@ -68,7 +69,7 @@ class ExitCommand(Command):
if not ui.choice('realy quit?', choices={'yes':['y','q','enter'],
'no':['n']}) == 'yes':
return
- ui.shutdown()
+ raise urwid.ExitMainLoop()
class OpenThreadCommand(Command):
@@ -833,9 +834,9 @@ class EnvelopeSendCommand(Command):
account = ui.accountman.get_account_by_address(saddr)
if account:
clearme = ui.notify('sending..', timeout=-1, block=False)
- success, reason = account.send_mail(mail)
+ reason = account.send_mail(mail)
ui.clear_notify([clearme])
- if success:
+ if not reason: # sucessfully send mail
cmd = BufferCloseCommand(buffer=envelope)
ui.apply_command(cmd)
ui.notify('mail send successful')
diff --git a/alot/ui.py b/alot/ui.py
index 42e432c3..dce11a0a 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -76,12 +76,6 @@ class UI:
def keypress(self, key):
self.logger.debug('unhandeled input: %s' % key)
- def shutdown(self):
- """
- close the ui. this is _not_ the main shutdown procedure:
- there is a shutdown command that will eventually call this.
- """
- raise urwid.ExitMainLoop()
def prompt(self, prefix='>', text=u'', tab=0, completer=None):
self.logger.info('open prompt')