summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-16 01:05:50 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-16 01:05:50 +0100
commit0d9535b94187380a315c62ffc668722a6c7cb167 (patch)
tree52723d63d78ce9c4e2302f07a8299166dbfbe30d /alot
parentca57324ac2480674ac54404e102bd118d16c5d9b (diff)
helpstrings and cleanup search commands
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/search.py32
1 files changed, 14 insertions, 18 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py
index a28db05e..4e82bdaf 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.py
@@ -9,9 +9,9 @@ from alot import buffers
MODE = 'search'
-@registerCommand(MODE, 'openthread', {}) # todo: make this select
+@registerCommand(MODE, 'openthread', # todo: make this a select
+ help='open a new thread buffer')
class OpenThreadCommand(Command):
- """open a new thread-view buffer"""
def __init__(self, thread=None, **kwargs):
self.thread = thread
Command.__init__(self, **kwargs)
@@ -29,10 +29,9 @@ class OpenThreadCommand(Command):
@registerCommand(MODE, 'toggletag', arguments=[
- (['tag'], {'nargs':'+', 'default':'', 'help':'tag to flip'})]
-)
+ (['tag'], {'nargs':'+', 'default':'', 'help':'tag to flip'})],
+ help='toggles tags in selected thread')
class ToggleThreadTagCommand(Command):
- """toggles tags in given or currently selected thread"""
def __init__(self, tag, thread=None, **kwargs):
assert tag
self.thread = thread
@@ -73,10 +72,9 @@ class ToggleThreadTagCommand(Command):
@registerCommand(MODE, 'refine', arguments=[
- (['query'], {'nargs':'*', 'default':'', 'help':'search string'})]
-)
+ (['query'], {'nargs':'*', 'default':'', 'help':'search string'})],
+ help='refine the query of the currently open searchbuffer')
class RefineCommand(Command):
- """refine the query of the currently open searchbuffer"""
def __init__(self, query=None, **kwargs):
self.querystring = ' '.join(query)
Command.__init__(self, **kwargs)
@@ -99,20 +97,18 @@ class RefineCommand(Command):
ui.notify('empty query string')
-@registerCommand(MODE, 'refineprompt', {})
+@registerCommand(MODE, 'refineprompt',
+ help='prompt to change current search buffers query')
class RefinePromptCommand(Command):
- """prompt to change current search buffers query"""
def apply(self, ui):
sbuffer = ui.current_buffer
oldquery = sbuffer.querystring
ui.commandprompt('refine ' + oldquery)
-@registerCommand(MODE, 'retagprompt', {})
+@registerCommand(MODE, 'retagprompt',
+ help='prompt to retag selected threads\' tags')
class RetagPromptCommand(Command):
- """start a commandprompt to retag selected threads' tags
- this is needed to fill the prompt with the current tags..
- """
def apply(self, ui):
thread = ui.current_buffer.get_selected_thread()
if not thread:
@@ -122,10 +118,9 @@ class RetagPromptCommand(Command):
@registerCommand(MODE, 'retag', arguments=[
- (['tags'], {'help':'comma separated list of tags'})]
-)
+ (['tags'], {'help':'comma separated list of tags'})],
+ help='overwrite selected thread\'s tags')
class RetagCommand(Command):
- """tag selected thread"""
def __init__(self, tags=u'', thread=None, **kwargs):
self.tagsstring = tags
self.thread = thread
@@ -150,4 +145,5 @@ class RetagCommand(Command):
# refresh selected threadline
sbuffer = ui.current_buffer
threadwidget = sbuffer.get_selected_threadline()
- threadwidget.rebuild() # rebuild and redraw the line
+ # rebuild and redraw the line
+ threadwidget.rebuild()