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

Method makePages

Lib/pagebot/document.py:1077–1094  ·  view source on GitHub ↗

If no "point" is defined as page number `pn`, then we'll continue after the maximum value of `page.y` origin position. If template is undefined, then `self.newPage` will use `self.defaultTemplate` to initialize the new pages. >>> doc = Document(autoPages=2) >

(self, pageCnt=1, pn=None, template=None, name=None, w=None,
            h=None, **kwargs)

Source from the content-addressed store, hash-verified

1075 del self.pages[pn]
1076
1077 def makePages(self, pageCnt=1, pn=None, template=None, name=None, w=None,
1078 h=None, **kwargs):
1079 """If no "point" is defined as page number `pn`, then we'll continue
1080 after the maximum value of `page.y` origin position. If template is
1081 undefined, then `self.newPage` will use `self.defaultTemplate` to
1082 initialize the new pages.
1083
1084 >>> doc = Document(autoPages=2)
1085 >>> doc.makePages(2)
1086 >>> len(doc.pages), sorted(doc.pages.keys())
1087 (4, [1, 2, 3, 4])
1088 """
1089 if pn is None:
1090 pn = max(self.pages.keys() or [0])+1
1091
1092 for n in range(pageCnt): # First page is n + pn
1093 # Parent is forced to self.
1094 self.newPage(pn=pn+n, template=template, name=name, w=w, h=h, **kwargs)
1095
1096 def getElementPage():
1097 """Search ancestors for the page element. This call can only happen

Callers 1

__init__Method · 0.95

Calls 2

newPageMethod · 0.95
keysMethod · 0.45

Tested by

no test coverage detected