dpu.vpd.db module
- class dpu.vpd.db.DPUVpdDatabase(db_path: Optional[str] = None)
Bases:
objectRepresentation of a VPD Database
- Parameters:
db (struct_dpu_vpd_database) – internal representation of the database
- Raises:
DPUVpdError – if an error occurs
- add_byte(key: str, byte: int) None
Add the key/value pair to the database
- Parameters:
key (str) – key
byte (int) – byte value
- Raises:
DPUVpdError – if the database cannot be updated
- add_bytearray(key: str, byte_array: bytearray) None
Add the key/value pair to the database
- Parameters:
key (str) – key
byte_array (bytearray) – byte array
- Raises:
DPUVpdError – if the database cannot be updated
- add_int(key: str, integer: int) None
Add the key/value pair to the database
- Parameters:
key (str) – key
integer (int) – integer value
- Raises:
DPUVpdError – if the database cannot be updated
- add_long(key: str, long: int) None
Add the key/value pair to the database
- Parameters:
key (str) – key
long (int) – long value
- Raises:
DPUVpdError – if the database cannot be updated
- add_numeric(key: str, val: int) None
Add the key/value pair to the database. This function chooses the c type that fits best.
- Parameters:
key (str) – key
long (int) – integer value
- Raises:
DPUVpdError – if the database cannot be updated
- add_short(key: str, short: int) None
Add the key/value pair to the database
- Parameters:
key (str) – key
short (int) – short value
- Raises:
DPUVpdError – if the database cannot be updated
- add_string(key: str, string: str) None
Add the key/value pair to the database
- Parameters:
key (str) – key
string (str) – string value
- Raises:
DPUVpdError – if the database cannot be updated
- dump() None
Display the database
- write_to_device(rank_name: str) None
Encode the database and write it to the specified rank
- Parameters:
rank_name (str) – rank to write
- Raises:
DPUVpdError – if the database cannot be written to the rank
- write_to_file(file_name: str) None
Encode the database and dump its content into file
- Parameters:
file_name (str) – output file name
- Raises:
DPUVpdError – if the database cannot be dumped into file
- exception dpu.vpd.db.DPUVpdError
Bases:
ExceptionError raised by the API