panda3d.core Results does not exist?

I’m trying to use vfs.findALL() which requires the Results class to put the results to. However it does not seem to exist. I’ve tried

from panda3d.core import Results
from panda3d.core.Results import Results
From panda3d.core import *

It actually uses a DSearchPath.Results object. Looks like a minor bug in the generated API documentation.

David

Ok, good to know. Next question. vfs.findAllFiles() does not seem to accept wildcards. Is this correct? If not, what would be the best way to search the vfs using wildcards?

My gui text is located in TXT_*.yaml files, and I would prefer to not hardcode the filenames. Before I was using glob to find all the files, but glob does not work so well in a p3d file :slight_smile:

Hmm, guess you’ll have to walk through the full list of files returned by findAllFiles(), and compare each one to your pattern, for instance with the fnmatch module, or with Panda’s own GlobPattern class. This is actually the way glob is implemented anyway.

But it does sound like we’ve overlooked an obvious need for direct.stdpy.glob, which should become the default glob module when running from a p3d file. I’ll add this.

David

Oh, also note that vfs.scanDirectory() might be an easier method to use for this purpose.

David

I’ve checked in the new direct.stdpy.glob module, and in 1.7.1 and later, this will be the default glob module when running in a p3d file.

But looking over the existing glob module, I think it should work as-is, even in a p3d file. Have you tried it? Note that files within the p3d file will be located at the directory named by base.appRunner.multifileRoot, not necessarily the current directory (but this will also be changed in 1.7.1).

David