pylintext.py
changeset 8190 2a3c1b787688
parent 8061 88ca47ceb9f2
child 8216 99ff746e8de8
equal deleted inserted replaced
8189:2ee0ef069fa7 8190:2a3c1b787688
    13         rnode.parent.body.remove(rnode)
    13         rnode.parent.body.remove(rnode)
    14     # that seems to be enough :)
    14     # that seems to be enough :)
    15 
    15 
    16 
    16 
    17 def cubicweb_transform(module):
    17 def cubicweb_transform(module):
    18     # handle objectify_selector decorator. Only look at module level functions,
    18     # handle objectify_predicate decorator (and its former name until bw compat
    19     # should be enough
    19     # is kept). Only look at module level functions, should be enough.
    20     for assnodes in module.locals.values():
    20     for assnodes in module.locals.values():
    21         for node in assnodes:
    21         for node in assnodes:
    22             if isinstance(node, scoped_nodes.Function) and node.decorators:
    22             if isinstance(node, scoped_nodes.Function) and node.decorators:
    23                 for decorator in node.decorators.nodes:
    23                 for decorator in node.decorators.nodes:
    24                     for infered in decorator.infer():
    24                     for infered in decorator.infer():
    25                         if infered.name == 'objectify_selector':
    25                         if infered.name in ('objectify_predicate', 'objectify_selector'):
    26                             turn_function_to_class(node)
    26                             turn_function_to_class(node)
    27                             break
    27                             break
    28                     else:
    28                     else:
    29                         continue
    29                         continue
    30                     break
    30                     break