summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-12-10 14:07:32 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2011-12-10 14:07:32 +0000
commit938b71a2c7fda0c51925da7c212f07e77e182c92 (patch)
tree7a7d39b58ee2ad9a827ef77c2369e476681b8194 /alot
parented74bc9d4e73db4611f16e8c304aa0a66be48fac (diff)
docstrings for envelope commands
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/envelope.py46
-rw-r--r--alot/commands/globals.py8
2 files changed, 42 insertions, 12 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 6ee876a0..94a2e58d 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -17,10 +17,15 @@ from alot.helper import string_decode
MODE = 'envelope'
-@registerCommand(MODE, 'attach', help='attach files to the mail', arguments=[
+@registerCommand(MODE, 'attach', arguments=[
(['path'], {'help':'file(s) to attach (accepts wildcads)'})])
class AttachCommand(Command):
+ """attach files to the mail"""
def __init__(self, path=None, **kwargs):
+ """
+ :param path: files to attach (globable string)
+ :type path: str
+ """
Command.__init__(self, **kwargs)
self.path = path
@@ -42,11 +47,15 @@ class AttachCommand(Command):
ui.current_buffer.rebuild()
-@registerCommand(MODE, 'refine', help='prompt to change the value of a header',
- arguments=[
+@registerCommand(MODE, 'refine', arguments=[
(['key'], {'help':'header to refine'})])
class RefineCommand(Command):
+ """prompt to change the value of a header"""
def __init__(self, key='', **kwargs):
+ """
+ :param key: key of the header to change
+ :type key: str
+ """
Command.__init__(self, **kwargs)
self.key = key
@@ -56,8 +65,9 @@ class RefineCommand(Command):
ui.apply_command(globals.PromptCommand(cmdstring))
-@registerCommand(MODE, 'send', help='sends mail')
+@registerCommand(MODE, 'send')
class SendCommand(Command):
+ """send mail"""
@inlineCallbacks
def apply(self, ui):
currentbuffer = ui.current_buffer # needed to close later
@@ -113,9 +123,14 @@ class SendCommand(Command):
thread.start()
-@registerCommand(MODE, 'edit', help='edit currently open mail')
+@registerCommand(MODE, 'edit')
class EditCommand(Command):
+ """edit mail"""
def __init__(self, envelope=None, **kwargs):
+ """
+ :param envelope: email to edit
+ :type envelope: :class:`~alot.message.Envelope`
+ """
self.envelope = envelope
self.openNew = (envelope != None)
Command.__init__(self, **kwargs)
@@ -191,12 +206,20 @@ class EditCommand(Command):
ui.apply_command(cmd)
-@registerCommand(MODE, 'set', help='set header value', arguments=[
+@registerCommand(MODE, 'set', arguments=[
+ # TODO
#(['--append'], {'action': 'store_true', 'help':'keep previous value'}),
(['key'], {'help':'header to refine'}),
(['value'], {'nargs':'+', 'help':'value'})])
class SetCommand(Command):
+ """set header value"""
def __init__(self, key, value, append=False, **kwargs):
+ """
+ :param key: key of the header to change
+ :type key: str
+ :param value: new value
+ :type value: str
+ """
self.key = key
self.value = ' '.join(value)
self.append = append
@@ -207,10 +230,15 @@ class SetCommand(Command):
ui.current_buffer.rebuild()
-@registerCommand(MODE, 'unset', help='remove header field', arguments=[
+@registerCommand(MODE, 'unset', arguments=[
(['key'], {'help':'header to refine'})])
class UnsetCommand(Command):
+ """remove header field"""
def __init__(self, key, **kwargs):
+ """
+ :param key: key of the header to remove
+ :type key: str
+ """
self.key = key
Command.__init__(self, **kwargs)
@@ -219,8 +247,8 @@ class UnsetCommand(Command):
ui.current_buffer.rebuild()
-@registerCommand(MODE, 'toggleheaders',
- help='toggle display of all headers')
+@registerCommand(MODE, 'toggleheaders')
class ToggleHeaderCommand(Command):
+ """toggle display of all headers"""
def apply(self, ui):
ui.current_buffer.toggle_all_headers()
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 7cb285c2..826601a4 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -119,7 +119,7 @@ class RefreshCommand(Command):
(['--thread'], {'action': 'store_true', 'help':'run in separate thread'}),
(['--refocus'], {'action': 'store_true', 'help':'refocus current buffer \
after command has finished'}),
- (['cmd'], {'help':'command line to execute'})]
+ (['cmd'], {'help':'command line to execute'})],
)
class ExternalCommand(Command):
"""run external command"""
@@ -267,8 +267,9 @@ class BufferFocusCommand(Command):
"""
:param buffer: the buffer to focus or None
:type buffer: `alot.buffers.Buffer`
- :param offset: position of the buffer to focus relative to the currently
- focussed one. This is used only if `buffer` is set to `None`
+ :param offset: position of the buffer to focus relative to the
+ currently focussed one. This is used only if `buffer`
+ is set to `None`
:type offset: int
"""
self.buffer = buffer
@@ -303,6 +304,7 @@ class OpenBufferlistCommand(Command):
ui.buffer_open(bl)
bl.rebuild()
+
@registerCommand(MODE, 'taglist')
class TagListCommand(Command):
"""opens taglist buffer"""