Package comodit_client :: Package api :: Module sync :: Class SyncEngine

Class SyncEngine


Synchronization tool allowing to sync local and remote entities. Synchronization is not bidirectional, you must choose either to update a remote entity using a local entity as reference, either to update a local entity using a remote entity as reference. First case is called push, second case is called pull.

Local entities must be organized in the same way as Import tool generates.

Pushes and pulls may be "dry-runned" allowing to audit changes before actually applying them.

Instance Methods
 
__init__(self, folder_path)
Creates a new sync engine.
 
pull(self, remote_res, dry_run=False)
Pulls changes from remote entity.
 
push(self, remote_res, dry_run=False)
Pushes changes to remote entity.

Inherited from object: __long__, __native__, __nonzero__, __unicode__, next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, folder_path)
(Constructor)

 

Creates a new sync engine.

Parameters:
  • folder_path (string) - Path to local entity's directory.
Overrides: object.__init__

pull(self, remote_res, dry_run=False)

 

Pulls changes from remote entity.

Parameters:
  • remote_res (Entity) - Remote entity representation.
  • dry_run (bool) - Dry run flag. If true, diffs are displayed on standard output but not applied.

push(self, remote_res, dry_run=False)

 

Pushes changes to remote entity.

Parameters:
  • remote_res (Entity) - Remote entity representation.
  • dry_run (bool) - Dry run flag. If true, diffs are displayed on standard output but not applied.