From: Armaan Bhojwani Date: Thu, 11 Feb 2021 22:44:19 +0000 (-0500) Subject: Fix sort function X-Git-Tag: v0.6.0~18 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=25e3ada874ea7f277129b8d2e39b675bde340afe Fix sort function --- 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: