Recursive import script
I created this outline with this script, edited for brevity:
'''Recursively import all python files in a directory and clean the result.'''
@tabwidth -4 # For a better match.
dir_ = r'C:\leo.repo\leointeg\src'
theTypes = ['.ts', ]
g.cls()
c.recursiveImport(
add_context=True, # Override setting only if True/False
add_file_context=False, # Override setting only if True/False
dir_=dir_,
kind = '@clean', # '@auto', '@clean', '@nosent','@file',
add_path = True,
recursive = False,
safe_at_file = False,
theTypes = theTypes # ['.py', '.ts', '.js','.vue',],
)
As usual with @clean, some manual work at first was needed to properly assign lines to nodes. See below.
Updating after changes
After Félix makes changes, lines can again be assigned to the "wrong" nodes. This doesn't affect the perfect import, but it impedes study.
This is especially true after adding new methods. The @clean algorithm never creates new nodes, so the new methods get put at the end of an existing node.
It's easy to put the new methods in nodes of their own. Just select the new text, then do parse-body. This creates the new nodes, which you can promote as you like. I just did this today.
Leo's git diff command
vs codes git lense command is excellent, but Leo's git diff (gd) command is better. It clearly shows which nodes have changed, which is a much higher view than any pure-text view can possibly be.
Summary
I recommend ekr-leoInteg to anyone wanting to study Félix's work.
Edward