]> git.armaanb.net Git - lightcards.git/commitdiff
Fix sort function
authorArmaan Bhojwani <me@armaanb.net>
Thu, 11 Feb 2021 22:44:19 +0000 (17:44 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Thu, 11 Feb 2021 22:44:19 +0000 (17:44 -0500)
lightcards/display.py
lightcards/runner.py

index f51259396cd04cd2587cbdf92f993267531159aa..11a7a91d26cb1afdfed1b1c3800101743a00c79f 100644 (file)
@@ -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]
index 0d01ca16b8df467b0899e646d75d2485de6a001b..35651f92b5fd1d20cb7454b9bc1e1f34c661d1e6 100644 (file)
@@ -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: