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

Method getSortedPages

Lib/pagebot/document.py:1223–1230  ·  view source on GitHub ↗

Answers the dynamic list of pages, sorted by y, x and index.

(self, pageSelection=None)

Source from the content-addressed store, hash-verified

1221 return self.pages[pn][-1]
1222
1223 def getSortedPages(self, pageSelection=None):
1224 """Answers the dynamic list of pages, sorted by y, x and index."""
1225 pages = [] # List of (pn, pnPages) tuples of pages with the same page number.
1226 for pn, pnPages in sorted(self.pages.items()):
1227 if pageSelection is not None and not pn in pageSelection:
1228 continue
1229 pages.append((pn, pnPages))
1230 return pages
1231
1232 def getPageTree(self, pageTree=None):
1233 """Answer a nested dict/list of pages, interpreting their tree-relation (e.g. as

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected