From 9719184f652c666284785d33767fbcfd1d5fb3ea Mon Sep 17 00:00:00 2001 From: Emile Anclin Date: Mon, 22 Mar 2010 10:33:23 +0100 Subject: update custom checker in example/custom.py We don't use compiler.ast nodes, but astng nodes. --- examples/custom.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/custom.py b/examples/custom.py index 73b64e1..7e4d5e7 100644 --- a/examples/custom.py +++ b/examples/custom.py @@ -17,15 +17,13 @@ class MyASTNGChecker(BaseChecker): priority = -1 def visit_callfunc(self, node): - """called when a CallFunc node is encountered. See compiler.ast - documentation for a description of available nodes: - http://www.python.org/doc/current/lib/module-compiler.ast.html - ) - """ - if not (isinstance(node.node, astng.Getattr) - and isinstance(node.node.expr, astng.Name) - and node.node.expr.name == 'properties' - and node.node.attrname == 'create'): + """called when a CallFunc node is encountered. + + See logilab.astng for the description of available nodes.""" + if not (isinstance(node.func, astng.Getattr) + and isinstance(node.func.expr, astng.Name) + and node.func.expr.name == 'properties' + and node.func.attrname == 'create'): return in_class = node.frame() for param in node.args: -- cgit v1.2.1