summaryrefslogtreecommitdiff
path: root/alot/commands/globals.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-16 01:23:13 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-16 01:23:13 +0100
commitce805a14602daa3bcd38c8f20223f18bb4bc546e (patch)
treefe439a801b6f7801158ec3f9ce1a5e3e059f0598 /alot/commands/globals.py
parent0d9535b94187380a315c62ffc668722a6c7cb167 (diff)
helpstrings and pep8
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r--alot/commands/globals.py34
1 files changed, 14 insertions, 20 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 020d1dfc..28f028f1 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -34,10 +34,8 @@ class ExitCommand(Command):
ui.exit()
-@registerCommand(MODE, 'search',
- help='open a new search buffer', arguments=[
- (['query'], {'nargs':'*', 'default':'', 'help':'search string'})]
-)
+@registerCommand(MODE, 'search', help='open a new search buffer', arguments=[
+ (['query'], {'nargs':'*', 'default':'', 'help':'search string'})])
class SearchCommand(Command):
def __init__(self, query, **kwargs):
self.query = ' '.join(query)
@@ -64,8 +62,7 @@ class SearchCommand(Command):
@registerCommand(MODE, 'prompt', help='starts commandprompt', arguments=[
- (['startwith'], {'nargs':'?', 'default':'', 'help':'initial content of commandprompt'})]
-)
+ (['startwith'], {'nargs':'?', 'default':'', 'help':'initial content'})])
class PromptCommand(Command):
def __init__(self, startwith='', **kwargs):
self.startwith = startwith
@@ -82,10 +79,9 @@ class RefreshCommand(Command):
ui.update()
-@registerCommand(MODE, 'shellescape',help='calls external command',
- arguments=[
- (['cmd'], {'help':'command line to execute'})]
-)
+@registerCommand(MODE, 'shellescape', arguments=[
+ (['cmd'], {'help':'command line to execute'})],
+ help='calls external command')
class ExternalCommand(Command):
def __init__(self, cmd, path=None, spawn=False, refocus=True,
in_thread=False, on_success=None, **kwargs):
@@ -155,7 +151,7 @@ class ExternalCommand(Command):
#@registerCommand(MODE, 'edit', arguments=[
# (['--nospawn'], {'action': 'store_true', 'help':'spawn '}), #todo
-# (['path'], {'help':'file to edit'})]
+# (['path'], {'help':'file to edit'})]
#]
#)
class EditCommand(ExternalCommand):
@@ -277,11 +273,12 @@ class FlushCommand(Command):
ui.update()
return
+
#todo choices
-@registerCommand(MODE, 'help',
- help='display help for a command. Use \'bindings\' to display \
- all keybings interpreted in current mode.', arguments=[
- (['commandname'], {'help':'command or \'bindings\''})]
+@registerCommand(MODE, 'help', arguments=[
+ (['commandname'], {'help':'command or \'bindings\''})],
+ help='display help for a command. Use \'bindings\' to\
+ display all keybings interpreted in current mode.',
)
class HelpCommand(Command):
def __init__(self, commandname='', **kwargs):
@@ -338,8 +335,7 @@ class HelpCommand(Command):
if parser:
ui.notify(parser.format_help())
else:
- ui.notify('command %s not known in mode %s' % (self.commandname,
- ui.mode))
+ ui.notify('command not known: %s' % self.commandname)
@registerCommand(MODE, 'compose', help='compose a new email',
@@ -374,7 +370,6 @@ class ComposeCommand(Command):
if bcc:
self.mail['Bcc'] = encode_header('Bcc', ','.join(bcc))
-
@defer.inlineCallbacks
def apply(self, ui):
# TODO: fill with default header (per account)
@@ -430,8 +425,7 @@ class ComposeCommand(Command):
@registerCommand(MODE, 'move', help='move focus', arguments=[
- (['key'], {'nargs':'+', 'help':'direction'})]
-)
+ (['key'], {'nargs':'+', 'help':'direction'})])
@registerCommand(MODE, 'cancel', help='send cancel event',
forced={'key': 'cancel'})
@registerCommand(MODE, 'select', help='send select event',