Skip to content

PrefixPlaceholder#

Description off a placeholder text found in a file that must be replaced when installing the file into the prefix.

file_mode: FileMode property #

The type of the file, either binary or text.

Examples#

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[-1]
>>> entry.prefix_placeholder.file_mode
FileMode("text")
>>>

placeholder: str property #

The placeholder prefix used in the file. This is the path of the prefix when the package was build.

Examples#

>>> paths_json = PathsJson.from_path(
...     "../test-data/conda-22.9.0-py38haa244fe_2-paths.json"
... )
>>> entry = paths_json.paths[-1]
>>> entry.prefix_placeholder.placeholder
'D:\\bld\\conda_1667595064120\\_h_env'
>>>

__init__(file_mode, placeholder) #

Create a new prefix placeholder.

Parameters#

file_mode: FileMode The file mode of the entry. placeholder: str The placeholder prefix used in the file.

Examples#

>>> placeholder = PrefixPlaceholder(FileMode("text"), "placeholder")
>>> placeholder
PrefixPlaceholder(file_mode=FileMode("text"), placeholder="placeholder")
>>>

__repr__() #

Returns a representation of the PrefixPlaceholder.