heimdallr.utilities.nvidia.bindings.PrintableStructure

class heimdallr.utilities.nvidia.bindings.PrintableStructure[source]

Bases: Structure

Abstract class that produces nicer __str__ output than ctypes.Structure. e.g. instead of:

>>> print str(obj)
<class_name object at 0x7fdf82fef9e0>
this class will print

class_name(field_name: formatted_value, field_name: formatted_value)

_fmt_ dictionary of <str _field_ name> -> <str format> e.g. class that has _field_ ‘hex_value’, c_uint could be formatted with

_fmt_ = {“hex_value” : “%08X”}

to produce nicer output. Default fomratting string for all fields can be set with key “<default>” like:

_fmt_ = {“<default>” : “%d MHz”} # e.g all values are numbers in MHz.

If not set it’s assumed to be just “%s”

Exact format of returned str from this class is subject to change in the future.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)