- self.main_panel.bottom()
- self.main_win.clear()
- # If on the back of the card, show the content of the front side in
- # the header
- num_done = str(self.obj.getIdx() +
- 1).zfill(len(str(len(self.stack))))
- if self.obj.getSide() == 0:
- top = num_done + " | " + self.headers[self.obj.getSide()]
- else:
- top = num_done + " | " + self.headers[self.obj.getSide()] + \
- " | \"" + str(self.stack[self.obj.getIdx()][0]) + "\""
- header_width = mcols
- if mcols > 80:
- header_width = 80
-
- self.main_win.addstr(0, 0, textwrap.shorten(top, width=header_width,
- placeholder="…"), curses.A_BOLD)
-
- # Add horizontal line
- lin_width = header_width
- if len(top) < header_width:
- lin_width = len(top)
- self.main_win.hline(1, 0, curses.ACS_HLINE, lin_width)
-
- # Show current side
- self.main_win.addstr(2, 0, textwrap.fill(
- self.stack[self.obj.getIdx()][self.obj.getSide()],
- width=self.wrap_width()))
+ top = (
+ num_done
+ + " | "
+ + self.headers[self.current_card().getSide()]
+ + ' | "'
+ + str(self.current_card().getFront())
+ + '"'
+ )
+ header_width = mcols
+ if mcols > 80:
+ header_width = 80
+
+ self.main_win.addstr(
+ 0,
+ 0,
+ textwrap.shorten(top, width=header_width, placeholder="…"),
+ curses.A_BOLD,
+ )
+
+ # Add horizontal line
+ lin_width = header_width
+ if len(top) < header_width:
+ lin_width = len(top)
+ self.main_win.hline(1, 0, curses.ACS_HLINE, lin_width)
+
+ # Show current side
+ self.main_win.addstr(
+ 2,
+ 0,
+ textwrap.fill(
+ self.current_card().get(),
+ width=self.wrap_width(),
+ ),
+ )