def visit_inheritance_diagram(inner_func):
 def visitor(self, node):
  try:
   content = inner_func(self, node)
  except DotException as e:
   warning = self.document.reporter.warning(str(e), line=node.line)
   warning.parent = node
   node.children = [warning]
  else:
   source = self.document.attributes['source']
   self.body.append(content)
   node.children = []
 return visitor

def visit_inheritance_diagram ( inner_func ) : def visitor ( self , node ) : try : content = inner_func ( self , node ) except DotException as e : warning = self . document . reporter . warning ( str ( e ) , line = node . line ) warning . parent = node node . children = [ warning ] else : source = self . document . attributes [ 'source' ] self . body . append ( content ) node . children = [ ] return visitor
this is just a wrapper around html/latex_output_graph to make it easier to handle errors and insert warnings .