summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-05-21 09:07:11 -0700
committerPatrick Totzke <patricktotzke@gmail.com>2012-05-21 09:07:11 -0700
commite7c0edd33aea7631161e63f62fbadc48ad540cd0 (patch)
tree0708cf7378e6fa427a10a61c2971e644a46d98d2 /alot
parent66d5856ff3bcf498472d2a5fb4194c9e9ab7bbc9 (diff)
parent82e43d5f741ed674f0f5fd950eb9d5bf50054c53 (diff)
Merge pull request #454 from bjoernb/attachment_prefix
Attachment prefix
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)