MCPcopy Create free account
hub / github.com/Distrotech/reportlab / makeSlideTable

Function makeSlideTable

tools/pythonpoint/pythonpoint.py:251–287  ·  view source on GitHub ↗

Returns a table containing a collection of SlideWrapper flowables.

(slides, pageSize, docWidth, numCols)

Source from the content-addressed store, hash-verified

249
250
251def makeSlideTable(slides, pageSize, docWidth, numCols):
252 """Returns a table containing a collection of SlideWrapper flowables.
253 """
254
255 slides = handleHiddenSlides(slides)
256
257 # Set table style.
258 tabStyle = TableStyle(
259 [('GRID', (0,0), (-1,-1), 0.25, colors.black),
260 ('ALIGN', (0,0), (-1,-1), 'CENTRE')
261 ])
262
263 # Build table content.
264 width = docWidth/numCols
265 height = width * pageSize[1]/pageSize[0]
266 matrix = []
267 row = []
268 for slide in slides:
269 sw = SlideWrapper(width, height, slide, pageSize)
270 if (len(row)) < numCols:
271 row.append(sw)
272 else:
273 matrix.append(row)
274 row = []
275 row.append(sw)
276 if len(row) > 0:
277 for i in range(numCols-len(row)):
278 row.append('')
279 matrix.append(row)
280
281 # Make Table flowable.
282 t = Table(matrix,
283 [width + 5]*len(matrix[0]),
284 [height + 5]*len(matrix))
285 t.setStyle(tabStyle)
286
287 return t
288
289
290class SlideWrapper(Flowable):

Callers 1

saveAsHandoutMethod · 0.85

Calls 6

setStyleMethod · 0.95
TableStyleClass · 0.90
TableClass · 0.90
handleHiddenSlidesFunction · 0.85
SlideWrapperClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected