ConfigVariableSearchPath

from panda3d.core import ConfigVariableSearchPath
class ConfigVariableSearchPath

Bases:

Bases: ConfigVariableBase

This is similar to a ConfigVariableList, but it returns its list as a DSearchPath, 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 by getValue().

Unlike other ConfigVariable types, local changes (made by calling appendDirectory() and prependDirectory()) 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

Inheritance diagram of ConfigVariableSearchPath

__init__(name: str, default_value: DSearchPath, description: str, flags: int)
__init__(name: str, description: str, flags: int)
__init__(name: str, default_value: str, description: str, flags: int)
appendDirectory(directory: Filename)

Adds a new directory to the end of the search list.

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
property directories Sequence[Filename]

Returns the nth directory on the search list.

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
getDirectories() list
getDirectory(n: int) Filename

Returns the nth directory on the search list.

getNumDirectories() int

Returns the number of directories on the search list.

getValue() DSearchPath
isEmpty() bool

Returns true if the search list is empty, false otherwise.

output(out: ostream)
prependDirectory(directory: Filename)

Adds a new directory to the front of the search list.

prependPath(path: DSearchPath)

Adds all of the directories listed in the search path to the beginning of the search list.

property value DSearchPath
write(out: ostream)