maestral.utils.serializer

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

Module Contents

Functions

dropbox_stone_to_dict(obj: StoneStruct) → StoneType

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

error_to_dict(err: Exception) → ErrorType

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

sync_event_to_dict(event: SyncEvent) → StoneType

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

maestral.utils.serializer.StoneType[source]
maestral.utils.serializer.ErrorType[source]
maestral.utils.serializer.dropbox_stone_to_dict(obj: StoneStruct)StoneType[source]

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

maestral.utils.serializer.error_to_dict(err: Exception)ErrorType[source]

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

Parameters

err – Exception to convert.

Returns

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

maestral.utils.serializer.sync_event_to_dict(event: SyncEvent)StoneType[source]

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

Parameters

event – SyncEvent to convert.

Returns

Serialized SyncEvent.