Example #1
0
    def draw_side(self):
        for i, row in enumerate(self.board.rows_descriptions):
            rend_i = i + self.header_height
            # row = list(row)
            if not row:
                row = [0]

            rend_row = [ClueCell(val) for val in row]
            rend_row = pad(rend_row, self.side_width, Cell())
            self.cells[rend_i][:self.side_width] = rend_row
Example #2
0
    def draw_header(self):
        for i in range(self.header_height):
            for j in range(self.side_width):
                self.cells[i][j] = ThumbnailCell()

        for j, col in enumerate(self.board.columns_descriptions):
            rend_j = j + self.side_width
            if not col:
                col = [0]

            rend_column = [ClueCell(val) for val in col]
            rend_column = pad(rend_column, self.header_height, Cell())

            # self.cells[:self.header_height, rend_j] = rend_column
            for i, cell in enumerate(rend_column):
                self.cells[i][rend_j] = cell
Example #3
0
 def test_simple(self, to_pad):
     assert pad(to_pad, 5, 5) == [5, 5, 1, 2, 3]
Example #4
0
 def test_right(self, to_pad):
     assert pad(to_pad, 5, 5, left=False) == [1, 2, 3, 5, 5]
Example #5
0
 def test_already_enough(self, to_pad):
     assert pad(to_pad, 2, 5) == to_pad