def clear_canvas(self):
logger.debug("<STR_LIT>")<EOL>old_canvas = self.diagram_canvas<EOL><INDENT>logger.debug("<STR_LIT>" % canvas.components)<EOL>for component in canvas.components:<EOL><INDENT>canvas.remove(component)<EOL><DEDENT>logger.debug("<STR_LIT>" % canvas.components)<EOL>for component in canvas.components:<EOL><INDENT>canvas.remove(component)<EOL><DEDENT>logger.debug("<STR_LIT>" % canvas.components)<EOL>canvas.request_redraw()<EOL><DEDENT>new_canvas = Canvas()<EOL>new_canvas.copy_traits(old_canvas, ["<STR_LIT>", "<STR_LIT>"])<EOL>self.diagram_canvas = new_canvas<EOL>self.viewport.component=new_canvas<EOL>self.viewport.request_redraw()<EOL>return<EOL>
Removes all components from the canvas