Add the page to the page list at location (pix, piy). If there is no list yet at that location, then first create an empty list. Note that the pages are kept in the self.pages by reference, not changing their parent.
(self, page, pix, piy)
| 74 | self.pages = {} |
| 75 | |
| 76 | def place(self, page, pix, piy): |
| 77 | """Add the page to the page list at location (pix, piy). If there is no |
| 78 | list yet at that location, then first create an empty list. Note that |
| 79 | the pages are kept in the self.pages by reference, not changing their |
| 80 | parent.""" |
| 81 | assert pix in range(self.piw) and piy in range(self.pih) # Check if page is set in range. |
| 82 | if (pix, piy) not in self.pages: |
| 83 | self.pages[(pix, piy)] = [] |
| 84 | self.pages[(pix, piy)].append(page) |
| 85 | |
| 86 | def __len__(self): |
| 87 | """Answers the amount of required pages, based on the `self.wi * |