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

Method getMaxPageSizes

Lib/pagebot/document.py:1328–1363  ·  view source on GitHub ↗

Answers the (w, h, d) size of all pages together. If the optional pageSelection is defined (set of y-values), then only evaluate the selected pages. Clip the found values against the document min/max proportions. >>> doc = Document(name='TestDoc', w=500, h=500, autoP

(self, pageSelection=None)

Source from the content-addressed store, hash-verified

1326 return root # Answer the full tree.
1327
1328 def getMaxPageSizes(self, pageSelection=None):
1329 """Answers the (w, h, d) size of all pages together. If the optional
1330 pageSelection is defined (set of y-values), then only evaluate the
1331 selected pages. Clip the found values against the document min/max
1332 proportions.
1333
1334 >>> doc = Document(name='TestDoc', w=500, h=500, autoPages=10)
1335 >>> doc.getMaxPageSizes()
1336 (500pt, 500pt, 100pt)
1337 >>> page = doc[1]
1338 >>> page.size
1339 (500pt, 500pt)
1340 >>> page.w = 1400
1341 >>> page
1342 <Page #1 default (1400pt, 500pt)>
1343 >>> doc[4].h = 850
1344 >>> doc.getMaxPageSizes() # Clipped to max size
1345 (1400pt, 850pt, 100pt)
1346 """
1347
1348 w = h = d = 0
1349 for pn, pnPages in self.pages.items():
1350 if not pageSelection is None and not pn in pageSelection:
1351 continue
1352 for page in pnPages:
1353 w = max(page.w, w)
1354 h = max(page.h, h)
1355 d = max(page.d, d)
1356
1357 ''&#x27;
1358 if page.view.showCropMarks or page.view.showRegistrationMarks:
1359 cmSize = page.view.css('viewCropMarkSize')
1360 w += cmSize
1361 h += cmSize
1362 ''&#x27;
1363 return w, h, d
1364
1365 # S P E L L C H E C K
1366

Callers 2

buildMethod · 0.80
buildMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected