summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/__init__.py2
-rw-r--r--alot/commands/envelope.py14
2 files changed, 7 insertions, 9 deletions
diff --git a/alot/commands/__init__.py b/alot/commands/__init__.py
index 5df88747..6b84a50b 100644
--- a/alot/commands/__init__.py
+++ b/alot/commands/__init__.py
@@ -101,6 +101,8 @@ class registerCommand(object):
definition is decorated to register it as handler for
'save' in mode 'thread' and add boolean and string arguments::
+ .. code-block::
+
@registerCommand('thread', 'save', arguments=[
(['--all'], {'action': 'store_true', 'help':'save all'}),
(['path'], {'nargs':'?', 'help':'path to save to'})],
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index d0dce4be..82b87888 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -39,7 +39,7 @@ class AttachCommand(Command):
"""attach files to the mail"""
repeatable = True
- def __init__(self, path=None, **kwargs):
+ def __init__(self, path, **kwargs):
"""
:param path: files to attach (globable string)
:type path: str
@@ -50,14 +50,10 @@ class AttachCommand(Command):
def apply(self, ui):
envelope = ui.current_buffer.envelope
- if self.path: # TODO: not possible, otherwise argparse error before
- files = [g for g in glob.glob(os.path.expanduser(self.path))
- if os.path.isfile(g)]
- if not files:
- ui.notify('no matches, abort')
- return
- else:
- ui.notify('no files specified, abort')
+ files = [g for g in glob.glob(os.path.expanduser(self.path))
+ if os.path.isfile(g)]
+ if not files:
+ ui.notify('no matches, abort')
return
logging.info("attaching: %s", files)