Hello,
I was doing:
def constructDirContents(file):
dirList = []
nextkey = TIter(file.GetListOfKeys())
key = TKey(nextkey.Next())
while key.GetTitle():
if key.IsFolder() != 1:
dirItem = [key.ReadObj().ClassName(), key.GetName(), key.GetTitle()]
dirList.append(dirItem)
key = TKey(nextkey.Next())
return dirList
in order to construct a listing of all directory entries. Now I get an error that TKey() has no copy/constructor. Reading the changelogs and CVS I figured out that a copy-constructor was added to TKey to prevent the compiler from generating one, and this new copy-constructor is protected. Since there is no object casting in python when i try to do:
key = nextkey.Next()
key.GetTitle()
I get an error of: ‘NoneType’ object has no attribute ‘GetTitle’.
Can you tell me another way to iterate over all of the keys in a given directory?