Exemplo n.º 1
0
 def draw(self, frame: Frame):
     frame.add_line_at(self.x, self.y, list("Controls:"))
     if StateController.get_mode() == "COMMAND":
         frame.add_line_at(self.x, self.y + 1, list("q: EXIT"))
         frame.add_line_at(self.x, self.y + 2, list("i: INSERT mode"))
         frame.add_line_at(self.x, self.y + 3, list("s: SAVE"))
     elif StateController.get_mode() == "INSERT":
         frame.add_line_at(self.x, self.y + 1, list("Backspace: "))
         frame.add_line_at(self.x, self.y + 2, list(" COMMAND mode"))
         frame.add_line_at(self.x, self.y + 3, list("OTHER: insert char"))
Exemplo n.º 2
0
 def draw(self, frame: Frame):
     frame.add_line_at(self.x, self.y, list("MODE:"))
     frame.add_line_at(self.x, self.y + 1, list(StateController.get_mode()))
Exemplo n.º 3
0
 def test_get_mode(self):
     self.assertEqual(StateController.get_mode(), StateController._mode,
                      "get_mode() returned wrong value")