summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorbjoernb <post@bjoern.homelinux.org>2012-05-21 15:52:45 +0200
committerbjoernb <post@bjoern.homelinux.org>2012-05-21 16:10:41 +0200
commit82e43d5f741ed674f0f5fd950eb9d5bf50054c53 (patch)
tree8dd8e23bd57fb445b00b60bb17a641332e29a432 /alot
parent8534cb85976474f04d07fbf67cc7a5eb944e6d2b (diff)
added support for configurable attachment download directory
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/thread.py5
-rw-r--r--alot/defaults/alot.rc.spec3
2 files changed, 6 insertions, 2 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py
index d8da5084..767b5eb9 100644
--- a/alot/commands/thread.py
+++ b/alot/commands/thread.py
@@ -609,11 +609,12 @@ class SaveAttachmentCommand(Command):
@inlineCallbacks
def apply(self, ui):
pcomplete = completion.PathCompleter()
+ savedir = settings.get('attachment_prefix', '~')
if self.all:
msg = ui.current_buffer.get_selected_message()
if not self.path:
self.path = yield ui.prompt('save attachments to',
- text=os.path.join('~', ''),
+ text=os.path.join(savedir, ''),
completer=pcomplete)
if self.path:
if os.path.isdir(os.path.expanduser(self.path)):
@@ -636,7 +637,7 @@ class SaveAttachmentCommand(Command):
filename = attachment.get_filename()
if not self.path:
msg = 'save attachment (%s) to ' % filename
- initialtext = os.path.join('~', filename)
+ initialtext = os.path.join(savedir, filename)
self.path = yield ui.prompt(msg,
completer=pcomplete,
text=initialtext)
diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec
index dc1c3c1f..49bb95de 100644
--- a/alot/defaults/alot.rc.spec
+++ b/alot/defaults/alot.rc.spec
@@ -1,6 +1,9 @@
ask_subject = boolean(default=True) # ask for subject when compose
+# directory prefix for downloading attachments
+attachment_prefix = string(default='~')
+
# confirm exit
bug_on_exit = boolean(default=False)