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 get_value().

Unlike other ConfigVariable types, local changes (made by calling append_directory() and prepend_directory()) 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)
append_directory(directory: Filename)

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

append_path(path: DSearchPath)

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

append_path(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.

clear_local_value() 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.

find_all_files(filename: Filename) Results

This variant of find_all_files() returns the new Results object, instead of filling on in on the parameter list. This is a little more convenient to call from Python.

find_all_files(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.

find_file(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.

get_default_value() DSearchPath
get_directories() list
get_directory(n: int) Filename

Returns the nth directory on the search list.

get_num_directories() int

Returns the number of directories on the search list.

get_value() DSearchPath
is_empty() bool

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

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

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

prepend_path(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)