Skip to content

Commit

Permalink
Alphabetize initial results by keyword.
Browse files Browse the repository at this point in the history
Sorts the initial list of workflow keywords alphabetically, for easier browsing.
  • Loading branch information
Rich Vreeland committed Jul 22, 2018
1 parent 883d628 commit 2bd57f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/alfredhelp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#coding: utf
__author__ = u'pochemuto'
import sys, plistlib, os
import sys, plistlib, os, operator
from os import path
from workflow import Workflow, ICON_HELP, ICON_INFO
from workflow.background import run_in_background, is_running
Expand Down Expand Up @@ -33,6 +33,9 @@ def main(wf):
)

if args.show_keywords and actions:
# Alphabetize initial results by keyword.
actions = sorted(actions, key=operator.attrgetter('keyword'))

if args.query:
actions = wf.filter(args.query, actions, key=search_key, min_score=20)

Expand Down

0 comments on commit 2bd57f5

Please sign in to comment.