def extract_duck_types(self,node,class_node): """ generate attrs and handle duck info about this attrs """ DuckLinker.handle_attrs(self, node, class_node) if isinstance(node, (AssAttr,Getattr)): if isinstance(node, Getattr): self.handle_getattr_local(node, node.frame().duck_info,True) elif isinstance(node, AssAttr): self.handle_assattr_local(node, node.frame().duck_info) ''' Handle only 1 level Getattr-s''' return for child in node.get_children(): # Ignoring handling nested functions, it will be handled in another visit if not isinstance(child, (Function,Lambda,Class)): self.extract_duck_types(child,class_node)
def visit_class(self,node): DuckLinker.visit_class(self, node)
def __init__(self, project_name, out_xml): IdGeneratorMixIn.__init__(self) DuckLinker.__init__(self) self._project_name = project_name self._out_xml = out_xml
def leave_project(self, node): """ add complete class signatures """ DuckLinker.leave_project(self, node)