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
strseparated byseparator.remove_value(elem)Removes all occurrences of elem from the array.
type_description()An array of string elements separated by a separator.
Attributes
extended_attributesReturns the object managing the extended attributes (user-facing knowledge) about the variable.
nameThe name of the variable.
separatorGet the separator the object was instantiated with.
valueGet the copy of the value of the variable, as a
list.