root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.54k stars 1.23k forks source link

rootprint/rootls missing recursive traversal #13659

Open ferdymercury opened 10 months ago

ferdymercury commented 10 months ago

Explain what you would like to see improved and how.

rootprint does not output canvases that are stored inside a subdirectory.

The CLI should accept a 'recursive' parameter that allows to deal with these cases

Additional context

https://root-forum.cern.ch/t/saving-all-plots-from-a-root-file-into-separate-png-files/56379/3?u=ferhue

couet commented 9 months ago

The code is in $ROOTSYS/main/python/cmdLineUtils.py at line 1394. The function retrieving the list of objects to be printed is:

def _keyListExtended(rootFile,pathSplitList):
    keyList,dirList = keyClassSpliter(rootFile,pathSplitList)
    for pathSplit in dirList: keyList.extend(getKeyList(rootFile,pathSplit))
    keyList = [key for key in keyList if not isDirectoryKey(key)]
    keyListSort(keyList)
    return keyList

Somehow it should be extended in order to scan sub-directories.

ferdymercury commented 1 month ago

Reopening as the merged PR only implemented rootls but not yet rootprint