Skip to content

Decorators from a different module #15944

Answered by tausbn
Sim4n6 asked this question in Q&A
Mar 16, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

I think the reason your query as written isn't working is that in

@security_module.req("aaa")
def fct():
    pass

the decorator is not a Name, but a Call (specifically security_module.req("aaa")), of which the function part (security_module.req, accessible through getFunc) is an Attribute, of which the object (security_module, accessible through getObject) is a Name, whose id matches security%. Thus, you're missing a few levels of syntax in order to match the name.

You could of course extend this to account for all of those additional bits of syntax, but I still think this is going about it the wrong way. Instead, I would again urge you to use API graphs. First identify all references to s…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@tausbn
Comment options

Answer selected by Sim4n6
@Sim4n6
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants