root icon indicating copy to clipboard operation
root copied to clipboard

rootprint/rootls missing recursive traversal

Open ferdymercury opened this issue 1 year ago • 2 comments

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

ferdymercury avatar Sep 18 '23 08:09 ferdymercury

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.

couet avatar Sep 26 '23 06:09 couet

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

ferdymercury avatar May 17 '24 10:05 ferdymercury