From: Armaan Bhojwani Date: Sun, 31 Jan 2021 17:52:30 +0000 (-0500) Subject: Zfill all the everything X-Git-Tag: v0.3.0~4 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=9a03674645c2535cadedf2dc077ad7303e434435 Zfill all the everything --- diff --git a/lightcards/display.py b/lightcards/display.py index d45b9a4..a707fc1 100755 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -27,7 +27,7 @@ def disp_bar(stdscr, stack, headers, obj): "] [" + percent + "% (" + - str(obj.getIdx() + 1) + + str(obj.getIdx() + 1).zfill(len(str(len(stack)))) + "/" + str(len(stack)) + ")]" + @@ -98,11 +98,12 @@ def disp_card(stdscr, stack, headers, obj): else: # If on the back of the card, show the content of the front side in the # header + num_done = str(obj.getIdx() + 1).zfill(len(str(len(stack)))) if obj.getSide() == 0: - top = str(obj.getIdx() + 1) + " | " + headers[obj.getSide()] + top = num_done + " | " + headers[obj.getSide()] else: - top = str(obj.getIdx() + 1) + " | " + headers[obj.getSide()] \ - + " | \"" + str(stack[obj.getIdx()][0]) + "\"" + top = num_done + " | " + headers[obj.getSide()] + " | \"" + \ + str(stack[obj.getIdx()][0]) + "\"" header_width = mcols if mcols > 80: header_width = 80