From 25e3ada874ea7f277129b8d2e39b675bde340afe Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Thu, 11 Feb 2021 17:44:19 -0500 Subject: [PATCH] Fix sort function --- lightcards/display.py | 2 +- lightcards/runner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lightcards/display.py b/lightcards/display.py index f512593..11a7a91 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -133,7 +133,7 @@ class Menu: self.outer.stack = runner.get_orig()[1] self.menu_print("Stack reset!") elif key == "a": - self.outer.stack.sort() + self.outer.stack.sort(key=lambda x: x.front) self.menu_print("Stack alphabetized!") elif key == "u": [x.unStar() for x in self.outer.stack] diff --git a/lightcards/runner.py b/lightcards/runner.py index 0d01ca1..35651f9 100644 --- a/lightcards/runner.py +++ b/lightcards/runner.py @@ -64,7 +64,7 @@ def show(args, stack, headers): if args.shuffle: shuffle(stack) if args.alphabetize: - stack.sort() + stack.sort(key=lambda x: x.front) if args.reverse: stack.reverse() if args.flip: -- 2.39.2