envprobe.vartypes.array.Array

class Array(name, separator, raw_value)

An environment variable where elements are separated by a separator.

Note

The instance can be used like list, i.e. __getitem__(), __setitem__() and __delitem__() are implemented.

Create a new array with the given separator by splitting raw_value.

__init__(name, separator, raw_value)

Create a new array with the given separator by splitting raw_value.

Methods

__init__(name, separator, raw_value)

Create a new array with the given separator by splitting raw_value.

apply_diff(diff)

Applies the given diff actions.

diff(old, new)

Generate an iterable difference "actions" between two variables.

insert_at(idx, elem)

Insert the element at a given index.

merge_diff(diff_a, diff_b)

Merges the two diffs into a diff that simulates applying diff_a first and then diff_b.

raw()

Convert the value to raw shell representation, i.e. a str separated by separator.

remove_value(elem)

Removes all occurrences of elem from the array.

type_description()

An array of string elements separated by a separator.

Attributes

extended_attributes

Returns the object managing the extended attributes (user-facing knowledge) about the variable.

name

The name of the variable.

separator

Get the separator the object was instantiated with.

value

Get the copy of the value of the variable, as a list.