Data Container

class hal_py.DataContainer

Container to hold data that is associated with an entity.

property data

A dict from ((1) category, (2) key) to ((1) type, (2) value) containing all stored data entries.

Type

dict[tuple(str,str),tuple(str,str)]

delete_data(self: hal_py.DataContainer, category: str, key: str, log_with_info_level: bool = False) bool

Delete a data entry.

Parameters
  • category (str) – The data key category.

  • key (str) – The data key.

  • log_with_info_level (bool) – Force explicit logging channel ‘netlist’ with log level ‘info’ to trace GUI events.

Returns

True on success, false otherwise.

Return type

bool

get_data(self: hal_py.DataContainer, category: str, key: str) Tuple[str, str]

Get the data entry specified by the given category and key.

Parameters
  • category (str) – The data key category.

  • key (str) – The data key.

Returns

The tuple ((1) type, (2) value).

Return type

tuple(str,str)

get_data_map(self: hal_py.DataContainer) Dict[Tuple[str, str], Tuple[str, str]]

Get a dict from ((1) category, (2) key) to ((1) type, (2) value) containing all stored data entries.

Returns

The stored data as a dict.

Return type

dict[tuple(str,str),tuple(str,str)]

has_data(self: hal_py.DataContainer, category: str, key: str) bool

Determine whether an entry of given category and key exists.

Parameters
  • category (str) – The data key category.

  • key (str) – The data key.

Returns

True if the entry exists, False otherwise.

Return type

bool

set_data(self: hal_py.DataContainer, category: str, key: str, data_type: str, value: str, log_with_info_level: bool = False) bool

Add a data entry.<br> May overwrite an existing entry.

Parameters
  • category (str) – The data key category.

  • key (str) – The data key.

  • data_type (str) – The data type.

  • value (str) – The data value.

  • log_with_info_level (bool) – Force explicit logging channel ‘netlist’ with log level ‘info’ to trace GUI events.

Returns

True on success, false otherwise.

Return type

bool