ConfigVariableSearchPath

from acron.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

digraph inheritance6a5a265554 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "ConfigFlags" [URL="acron.core.ConfigFlags.html#acron.core.ConfigFlags",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ConfigFlags" [arrowsize=0.75,style=""]; "ConfigVariableBase" [URL="acron.core.ConfigVariableBase.html#acron.core.ConfigVariableBase",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ConfigFlags" -> "ConfigVariableBase" [arrowsize=0.75,style=""]; "ConfigVariableSearchPath" [URL="acron.core.ConfigVariableSearchPath.html#acron.core.ConfigVariableSearchPath",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "ConfigVariableBase" -> "ConfigVariableSearchPath" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; }
__init__()
append_directory()

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

append_path()

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

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

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

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.

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

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()
get_directories() → list
get_directory()

Returns the nth directory on the search list.

get_num_directories()

Returns the number of directories on the search list.

get_value()
is_empty()

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

output()
prepend_directory()

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

prepend_path()

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

property value → DSearchPath
write()