summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-29 14:02:12 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-29 14:02:12 +0100
commit0f2198c62185837410cf0c8d9a6e7110e4cb965d (patch)
tree3dbc0ede24d913fdb38c98c969569e48621682c0
parenteaff664b2fc10e57dd68f3f2c070300130213fd0 (diff)
SendCommand: remove unnecessary instance attribute
It is only used inside one function.
-rw-r--r--alot/commands/envelope.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 45830988..72c9d42d 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -161,7 +161,6 @@ class SendCommand(Command):
"""
super().__init__()
self.mail = mail
- self.envelope_buffer = None
def _get_keys_addresses(self, envelope):
addresses = set()
@@ -181,12 +180,13 @@ class SendCommand(Command):
return recipients_addresses.issubset(keys_addresses)
async def apply(self, ui):
- envelope = None
+ envelope = None
+ envelope_buffer = None
if self.mail is None:
# needed to close later
- self.envelope_buffer = ui.current_buffer
- envelope = self.envelope_buffer.envelope
+ envelope_buffer = ui.current_buffer
+ envelope = envelope_buffer.envelope
# This is to warn the user before re-sending
# an already sent message in case the envelope buffer
@@ -293,8 +293,8 @@ class SendCommand(Command):
initial_tags = envelope.tags
logging.debug('mail sent successfully')
ui.clear_notify(clearme)
- if self.envelope_buffer is not None:
- cmd = commands.globals.BufferCloseCommand(self.envelope_buffer)
+ if envelope_buffer is not None:
+ cmd = commands.globals.BufferCloseCommand(envelope_buffer)
await ui.apply_command(cmd)
ui.notify('mail sent successfully')
if envelope is not None: