From 2bd57f5a655cff453b12bd512fa31f6b524cb97d Mon Sep 17 00:00:00 2001 From: Rich Vreeland Date: Sat, 21 Jul 2018 19:04:57 -0700 Subject: [PATCH] Alphabetize initial results by keyword. Sorts the initial list of workflow keywords alphabetically, for easier browsing. --- src/alfredhelp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/alfredhelp.py b/src/alfredhelp.py index d5d2551..48d1232 100644 --- a/src/alfredhelp.py +++ b/src/alfredhelp.py @@ -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 @@ -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)