def visitGetattr(self, node): for c in node.getChildNodes(): self.visit(c) if node.attrname == self.targetmodule.name: if getTypeOfExpr(self.scope, node) == self.targetmodule: self.appendMatch(self.targetmodule.name) self.popWordsUpTo(node.attrname)
def visitName(self, node): if node.name == self.targetmodule.name: if getTypeOfExpr(self.scope, node) == self.targetmodule: self.appendMatch(node.name) self.popWordsUpTo(node.name)