Synchronisation

ctSESAM can synchronize your password settings with a ctSESAM-Server. The exact protocol is specified in the Wiki.

Basic communication part is implemented in the Sync class.

class sync.Sync(server_url, username, password, cert_filename)[source]

Sync connection wrapper.

Parameters:
pull()[source]

Read the base64 encoded data from the sync server.

Returns:base64 encoded data
Return type:str
push(data)[source]

Push data to the server. This overwrites data living there. Please pull and merge first.

Parameters:data (str) – base64 encoded data
Returns:was the push successful?
Return type:bool

This class is wrapped by a SyncManager which handles the settings management for the server connection.

Manages Sync connections.

class sync_manager.SyncManager[source]

Synchronization manager. This initializes and stores settings and handles the Sync object.

ask_for_sync_settings()[source]

Ask the user for sync settings: Asks for server-URL, username and password.

create_sync()[source]

creates a sync object.

get_binary_sync_settings()[source]

returns packed sync settings

Returns:binary settings
Return type:bytes
has_settings()[source]

Returns true if pull or push are possible

Returns:Are there settings?
Return type:bool
load_binary_sync_settings(data)[source]

loads sync settings

Parameters:data (bytes) – packed json data of sync settings
pull()[source]

pulls data from the sync server. Returns an empty string if no connection is possible.

Returns:pulled base64 data
Return type:str
push(data)[source]

pushes data to the sync server. If the push fails an error message is displayed.

Parameters:data (str) – base64 data