smartinspectpython.siprotocolvariables
Module: siprotocolvariables.py
Revision History
Date | Version | Description |
---|---|---|
2023/05/30 | 3.0.0.0 | Initial Version. |
Manages connection variables.
This class manages a list of connection variables. Connection variables are placeholders for strings in the Connections of the SmartInspect class. Please see SmartInspect.SetVariable for more information.
Threadsafety:
This class is fully thread-safe.
Adds a new element with a specified key and value to the set of connection variables.
Arguments:
- key (str): The key of the element.
- value (str): The value of the element.
Raises:
- SIArgumentNullException: The key or value argument is null.
This method adds a new element with a given key and value to the set of connection variables. If an element for the given key already exists, the original element's value is not updated.
Tests if the collection contains a value for a given key.
Arguments:
- key (str): The key of the element to test.
Raises:
- SIArgumentNullException: The key argument is null.
True if a value exists for the given key and false otherwise.
Expands and returns a connections string.
Arguments:
- connections (str): The connections string to expand and return.
Returns:
The expanded connections string.
Raises:
- SIArgumentNullException: The connections argument is null.
This method replaces all variables which have previously been added to this collection (with Add or Put) in the given connections string with their respective values and then returns it. Variables in the connections string must have the following form: $variable$.
Returns a value of an element for a given key.
Arguments:
- key (str): The key whose value to return.
Raises:
- SIArgumentNullException: The key argument is null.
Either the value for a given key if an element with the given key exists or null otherwise.
Adds or updates an element with a specified key and value to the set of connection variables.
Arguments:
- key (str): The key of the element.
- value (str): The value of the element.
Raises:
- SIArgumentNullException: The key or value argument is null.
This method adds a new element with a given key and value to the set of connection variables. If an element for the given key already exists, the original element's value is updated.
Removes an existing element with a given key from this set of connection variables.
Arguments:
- key (str): The key of the element to remove.
Raises:
- SIArgumentNullException: The key argument is null.
This method removes the element with the given key from the internal set of connection variables. Nothing happens if no element with the given key can be found.