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

Method getSortedPages

Lib/pagebot/elements/views/pageview.py:63–83  ·  view source on GitHub ↗

Get the dictionary of sorted pages from the document. Depending on the self.showSpread flag, the answered dictionary is the plain self.doc.getSortedPages() result, or wrapped as Quire instances containing positioned spread pages.

(self)

Source from the content-addressed store, hash-verified

61 return Quire(folds=folds, startPage=startPage, parent=self)
62
63 def getSortedPages(self):
64 """Get the dictionary of sorted pages from the document. Depending on
65 the self.showSpread flag, the answered dictionary is the plain
66 self.doc.getSortedPages() result, or wrapped as Quire instances
67 containing positioned spread pages."""
68 sortedPages = self.doc.getSortedPages()
69
70 if self.showSpread:
71 # Key is uneven page number. Value is a Quire, holding spread
72 # pages.
73 spreads = {}
74
75 '''
76 If the flag is set, compose the page dictionary into a dictionary
77 of larger pages, holding Quire instances that can compose various
78 layouts of the pages, including spreads. page.ml and page.mr define
79 the distance between the spread pages.
80 '''
81 sortedPages = Quire.pages2Spreads(QUIRE_SPREAD)
82
83 return sortedPages
84
85 def build(self, path=None, pageSelection=None, multiPage=True, **kwargs):
86 """Draw the selected pages. pageSelection is an optional set of

Callers 2

buildMethod · 0.95
buildMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected