IoticAgent.IOT.utils module

Utility functions

IoticAgent.IOT.utils.bool_from(obj, default=False)
Returns:True if obj is not None and its string representation is not 0 or False (case-insensitive). If obj is None, ‘default’ is used.
IoticAgent.IOT.utils.foc_to_str(foc)

Take the QAPI Resource code and return string of ‘feed’ or ‘control’

IoticAgent.IOT.utils.hex_to_uuid(hstr)

Make a 32 ascii char hex into a 8-4-4-4-12 uuid

IoticAgent.IOT.utils.private_name_for(var_name, cls)
Returns:Mangled variable name (if applicable) for the given variable and class instance. See https://docs.python.org/3/tutorial/classes.html#private-variables
IoticAgent.IOT.utils.private_names_for(cls, names)
Returns:Iterable of private names using privateNameFor()
IoticAgent.IOT.utils.str_to_foc(sfoc)

Take a string of ‘feed’ or ‘control’ and return the QAPI Resource Const.R_FEED or R_CONTROL

IoticAgent.IOT.utils.uuid_to_hex(uid)

Make 8-4-4-4-12 uuid into plain hex for the QAPI

IoticAgent.IOT.utils.version_string_to_tuple(version)