diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-19 16:10:45 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-19 16:10:45 +0100 |
commit | 2cd85de1cd1be47614d261fdbd19a6ebc351c2ef (patch) | |
tree | 38de392913f5d32e37c12df75f04ae8a5ea24a44 /alot/commands/thread.py | |
parent | fbdc7dce60987dc0833a0db031f6dca4f1e1fddc (diff) |
AttachmentWidget: drop a useless getter
Diffstat (limited to 'alot/commands/thread.py')
-rw-r--r-- | alot/commands/thread.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 6ceaddd2..89b278ce 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -835,8 +835,7 @@ class SaveAttachmentCommand(Command): else: # save focussed attachment focus = ui.get_deep_focus() if isinstance(focus, AttachmentWidget): - attachment = focus.get_attachment() - filename = attachment.get_filename() + filename = focus.attachment.get_filename() if not self.path: msg = 'save attachment (%s) to ' % filename initialtext = os.path.join(savedir, filename) @@ -845,7 +844,7 @@ class SaveAttachmentCommand(Command): text=initialtext) if self.path: try: - dest = attachment.save(self.path) + dest = focus.attachment.save(self.path) ui.notify('saved attachment as: %s' % dest) except (IOError, OSError) as e: ui.notify(str(e), priority='error') @@ -976,7 +975,7 @@ class ThreadSelectCommand(Command): focus = ui.get_deep_focus() if isinstance(focus, AttachmentWidget): logging.info('open attachment') - await ui.apply_command(OpenAttachmentCommand(focus.get_attachment())) + await ui.apply_command(OpenAttachmentCommand(focus.attachment)) else: await ui.apply_command(ChangeDisplaymodeCommand(visible='toggle')) |