]> git.armaanb.net Git - lightcards.git/commitdiff
Clean up lightcards.py
authorArmaan Bhojwani <me@armaanb.net>
Mon, 1 Feb 2021 03:30:34 +0000 (22:30 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Mon, 1 Feb 2021 03:30:34 +0000 (22:30 -0500)
lightcards/lightcards.py

index a996ccc8a46ab9aa315ab01ab4b287534bdbedca..ecd18d2cb40043c197758fb42a4c7dd0501eba33 100644 (file)
@@ -42,28 +42,31 @@ def parse_args():
 
 def show(args, stack, headers):
     """
-    Manipulate deck according to passed arguments, and send it to the display
-    functions
+    Get objects from cache, manipulate deck according to passed arguments, and
+    send it to the display functions
     """
+    # Purge caches if asked
     if args.purge:
         progress.purge(stack)
     if args.purge_all:
         progress.purge_all()
 
+    # Check for caches
     ida = progress.dive("status", stack)
-    if ida and not args.purge:
+    if ida:
         idx = ida
     else:
         idx = Status()
 
     stackb = progress.dive("stack", stack)
-    if stackb and not args.purge:
+    if stackb:
         stack = stackb
 
     headerb = progress.dive("headers", stack)
-    if headerb and not args.purge:
+    if headerb:
         headers = headerb
 
+    # Manipulate deck
     if args.flip:
         for x in stack:
             x[0], x[1] = x[1], x[0]
@@ -73,6 +76,7 @@ def show(args, stack, headers):
     if args.reverse:
         stack.reverse()
 
+    # Send to display
     win = Display(stack, headers, idx)
     wrapper(win.run)