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

Method __init__

Lib/pagebot/contexts/flatcontext/flatcontext.py:83–105  ·  view source on GitHub ↗

Constructor of Flat context. >>> context = FlatContext() >>> context.newPage(100, 100) >>> drawing = context.getDrawing() >>> drawing.__class__.__name__ 'document'

(self)

Source from the content-addressed store, hash-verified

81 UNITS = 'pt'
82
83 def __init__(self):
84 """Constructor of Flat context.
85
86 >>> context = FlatContext()
87 >>> context.newPage(100, 100)
88 >>> drawing = context.getDrawing()
89 >>> drawing.__class__.__name__
90 'document'
91 """
92 super().__init__()
93 self.b = flatBuilder
94
95 # Save current set of values on gState stack.
96 self.save()
97
98 # Current open shape.
99 self.shape = None
100 self.fileType = DEFAULT_FILETYPE
101 self._drawing = None
102 self._numberOfPages = 0
103 self._flatFonts = {} # Caching of {font.path:flatFont}
104 self.setTransform3D()
105 self._numberOfPages = 0
106
107 def setTransform3D(self):
108 """Initializes the transforrmation matrix to be used for translation,

Callers

nothing calls this directly

Calls 2

setTransform3DMethod · 0.95
saveMethod · 0.45

Tested by

no test coverage detected