maestral.utils.serializer

This module contains functions to serialize class instances for communication between the daemon and frontends.

maestral.utils.serializer.dropbox_stone_to_dict(obj)[source]

Converts the result of a Dropbox SDK call to a dictionary.

Parameters

obj (StoneStruct) –

Return type

Dict[str, Optional[Union[str, float, bool]]]

maestral.utils.serializer.error_to_dict(err)[source]

Converts an exception to a dict. Keys will be strings and entries are native Python types.

Parameters

err (Exception) – Exception to convert.

Returns

Dictionary where all keys and values are strings. The following keys will always be present but may contain empty strings: ‘type’, ‘inherits’, ‘title’, ‘traceback’, ‘title’, and ‘message’.

Return type

Dict[str, Optional[Union[str, Sequence[str]]]]

maestral.utils.serializer.sync_event_to_dict(event)[source]

Converts a SyncEvent to a dict. Keys will be strings and entries are native Python types.

Parameters

event (maestral.database.SyncEvent) – SyncEvent to convert.

Returns

Serialized SyncEvent.

Return type

Dict[str, Optional[Union[str, float, bool]]]