cterasdk.common.object module#

class cterasdk.common.object.Device(uid, version, firmware)#

Bases: Object

class cterasdk.common.object.Object(**kwargs)#

Bases: MutableMapping

class cterasdk.common.object.ObjectEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)#

Bases: JSONEncoder

default(o)#

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return super().default(o)
cterasdk.common.object.delete_attr(obj, path)#

Delete attribute

Parameters:
Returns:

The modified object

Return type:

cterasdk.common.object.Object

cterasdk.common.object.delete_attrs(obj, paths)#

Delete attributes

Parameters:
Returns:

The modified object

Return type:

cterasdk.common.object.Object

cterasdk.common.object.find_attr(obj, path)#

Find attribute

Parameters:
Returns:

The attribute, or None if not found

cterasdk.common.object.get_attr(obj, attr)#

Get attribute

Parameters:
Returns:

The attribute, or None if not found

cterasdk.common.object.remove_array_element(array, attr)#
cterasdk.common.object.remove_array_element_by_key(array, key, value)#
cterasdk.common.object.remove_attr(obj, attr)#

Remove attribute

Parameters: