MCPcopy Create free account
hub / github.com/PageBot/PageBot / place

Method place

Lib/pagebot/elements/quire.py:76–84  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 *

Callers 7

_placeMethod · 0.80
imageMethod · 0.80
rectMethod · 0.80
circleMethod · 0.80
lineMethod · 0.80
drawShapePathMethod · 0.80
__init__Method · 0.80

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected