ConfigVariableSearchPath
from panda3d.core import ConfigVariableSearchPath
- class ConfigVariableSearchPath
Bases:
Bases:
ConfigVariableBase
This is similar to a
ConfigVariableList
, but it returns its list as aDSearchPath
, as a list of directories.You may locally append directories to the end of the search path with the methods here, or prepend them to the beginning. Use these methods to make adjustments to the path; do not attempt to directly modify the const
DSearchPath
object returned bygetValue()
.Unlike other
ConfigVariable
types, local changes (made by callingappendDirectory()
andprependDirectory()
) are specific to this particular instance of the ConfigVariableSearchPath. A separate instance of the same variable, created by using the same name to the constructor, will not reflect the local changes.Inheritance diagram
- __init__(name: str, default_value: DSearchPath, description: str, flags: int)
- appendPath(path: DSearchPath)
Adds all of the directories listed in the search path to the end of the search list.
- appendPath(path: str, separator: str)
Adds all of the directories listed in the search path to the end of the search list.
- clear()
Removes all the directories locally added to the search list, and restores it to its original form.
- clearLocalValue() bool
Removes all the directories locally added to the search list, and restores it to its original form.
- property default_value DSearchPath
- findAllFiles(filename: Filename) Results
This variant of
findAllFiles()
returns the new Results object, instead of filling on in on the parameter list. This is a little more convenient to call from Python.
- findAllFiles(filename: Filename, results: Results) int
Searches all the directories in the search list for the indicated file, in order. Fills up the results list with all of the matching filenames found, if any. Returns the number of matches found.
It is the responsibility of the the caller to clear the results list first; otherwise, the newly-found files will be appended to the list.
- findFile(filename: Filename) Filename
Searches all the directories in the search list for the indicated file, in order. Returns the full matching pathname of the first match if found, or the empty string if not found.
- getDefaultValue() DSearchPath
- getValue() DSearchPath
- prependPath(path: DSearchPath)
Adds all of the directories listed in the search path to the beginning of the search list.
- property value DSearchPath