summaryrefslogtreecommitdiff
path: root/alot/commands/search.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-01-31 09:51:36 +0100
committerAnton Khirnov <anton@khirnov.net>2021-01-31 09:51:36 +0100
commitc83da858d191c663894bef6d192d9bb489b082f5 (patch)
treeae86ac2856d560c0a7c1c44acdf0c7249e8bb975 /alot/commands/search.py
parentcf6d0be6502b790f91c7f4e0f1738ef8381fab70 (diff)
db: use symbolic constants for sort orders
Diffstat (limited to 'alot/commands/search.py')
-rw-r--r--alot/commands/search.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/alot/commands/search.py b/alot/commands/search.py
index 14f267cd..82a3cf39 100644
--- a/alot/commands/search.py
+++ b/alot/commands/search.py
@@ -13,6 +13,7 @@ from .. import commands
from .. import buffers
from ..db.errors import DatabaseROError
+from ..db.sort import NAME as SORT_NAME
MODE = 'search'
@@ -35,8 +36,8 @@ class OpenThreadCommand(Command):
@registerCommand(MODE, 'refine', help='refine query', arguments=[
- (['--sort'], {'help': 'sort order', 'choices': [
- 'oldest_first', 'newest_first', 'message_id', 'unsorted']}),
+ (['--sort'], {'help': 'sort order',
+ 'choices': list(SORT_NAME.keys())}),
(['query'], {'nargs': argparse.REMAINDER, 'help': 'search string'})])
@registerCommand(MODE, 'sort', help='set sort order', arguments=[
(['sort'], {'help': 'sort order', 'choices': [
@@ -55,7 +56,7 @@ class RefineCommand(Command):
self.querystring = None
else:
self.querystring = ' '.join(query)
- self.sort_order = sort
+ self.sort_order = SORT_NAME[sort]
super().__init__(**kwargs)
def apply(self, ui):