[issue42920] How to add end_lineno in pyclbr?

2021-01-12 Thread Aviral Srivastava
New submission from Aviral Srivastava : I created a PR a year ago, https://github.com/python/cpython/pull/16466/files, and now the source code is completely changed. How do I create another PR or if there is another way through which I can get an end line for each object (class and function

[issue42920] How to add end_lineno in pyclbr?

2021-01-25 Thread Aviral Srivastava
Aviral Srivastava added the comment: But how do I generate the endline no? Initially, I could do, stack[-1][0].end_lineno = start[0] - 1 but how do I this now? Best, Aviral Srivastava LinkedIn <https://mailtrack.io/trace/link/c4502b41561cd995471aa8291b55e07212663a68?url=https%3A

[issue38307] Provide Class' end line in pyclbr module

2021-01-25 Thread Aviral Srivastava
Aviral Srivastava added the comment: How do I generate the endline no? Initially, I could do, stack[-1][0].end_lineno = start[0] - 1 but how do I this now given that the recent changes are operating on the AST instead of the token stream? -- nosy: +kebab-mai-haddi

[issue38307] Provide Class' end line in pyclbr module

2021-01-27 Thread Aviral Srivastava
Aviral Srivastava added the comment: I have made the changes and tested, my builds were successful. Please review it? CC @brandtbucher, @steven.daprano -- ___ Python tracker <https://bugs.python.org/issue38

[issue38307] Add .end_lineno attribute to pyclbr _Objects

2021-01-27 Thread Aviral Srivastava
Aviral Srivastava added the comment: Hey Terry, thanks for commenting. I have a few questions to ask you, please pardon my lack of awareness. >This requieres end lines and having it be an attribute is easier and more >accurate than recalculating it. How do you recalculate the end_

[issue43247] How to search for a __main__ module using pyclbr in Python3?

2021-02-17 Thread Aviral Srivastava
New submission from Aviral Srivastava : I want to get all the functions and classes in module: `__main__` of the source code directory: `/tmp/rebound/rebound`. When I use the `pyclbr.readmodule_ex` API: ``` source_code_data = pyclbr.readmodule_ex(source_code_module, path=source_code_path