def _showDrawingDemo(self, drawing, name): """Show a graphical demo of the drawing.""" # Add the given drawing to the story. # Ignored if no GD rendering available # or the demo method does not return a drawing. try: from reportlab.graphics import renderPM modName = self.skeleton.getModuleName() path = '%s-%s.jpg' % (modName, name) renderPM.drawToFile(drawing, path, fmt='JPG') self.outLines.append('<H3>Demo</H3>') self.outLines.append(makeHtmlInlineImage(path)) except: if VERBOSE: print 'caught exception in GraphHTMLDocBuilder._showDrawingDemo' traceback.print_exc() else: pass
def _showDrawingDemo(self, drawing, name): """Show a graphical demo of the drawing.""" # Add the given drawing to the story. # Ignored if no GD rendering available # or the demo method does not return a drawing. try: from reportlab.graphics import renderPM modName = self.skeleton.getModuleName() path = '%s-%s.jpg' % (modName, name) renderPM.drawToFile(drawing, path, fmt='JPG') self.outLines.append('<H3>Demo</H3>') self.outLines.append(makeHtmlInlineImage(path)) except: if VERBOSE: print('caught exception in GraphHTMLDocBuilder._showDrawingDemo') traceback.print_exc() else: pass
def _showWidgetDemo(self, widget): """Show a graphical demo of the widget.""" # Get a demo drawing from the widget and add it to the story. # Ignored if no GD rendering available # or the demo method does not return a drawing. try: from reportlab.graphics import renderPM drawing = widget.demo() if VERIFY: widget.verify() modName = self.skeleton.getModuleName() path = '%s-%s.jpg' % (modName, widget.__class__.__name__) renderPM.drawToFile(drawing, path, fmt='JPG') self.outLines.append('<H3>Demo</H3>') self.outLines.append(makeHtmlInlineImage(path)) except: if VERBOSE: print 'caught exception in GraphHTMLDocBuilder._showWidgetDemo' traceback.print_exc() else: pass
def _showWidgetDemo(self, widget): """Show a graphical demo of the widget.""" # Get a demo drawing from the widget and add it to the story. # Ignored if no GD rendering available # or the demo method does not return a drawing. try: from reportlab.graphics import renderPM drawing = widget.demo() if VERIFY: widget.verify() modName = self.skeleton.getModuleName() path = '%s-%s.jpg' % (modName, widget.__class__.__name__) renderPM.drawToFile(drawing, path, fmt='JPG') self.outLines.append('<H3>Demo</H3>') self.outLines.append(makeHtmlInlineImage(path)) except: if VERBOSE: print('caught exception in GraphHTMLDocBuilder._showWidgetDemo') traceback.print_exc() else: pass