b2sdk.sync.policy_manager
¶
-
class
b2sdk.sync.policy_manager.
SyncPolicyManager
[source]¶ Bases:
object
Policy manager; implement a logic to get a correct policy class and create a policy object based on various parameters.
-
get_policy
(sync_type, source_path: b2sdk.sync.path.AbstractSyncPath, source_folder, dest_path: b2sdk.sync.path.AbstractSyncPath, dest_folder, now_millis, delete, keep_days, newer_file_mode, compare_threshold, compare_version_mode, encryption_settings_provider)[source]¶ Return a policy object.
- Parameters
sync_type (str) – synchronization type
source_path (b2sdk.v1.AbstractSyncPath) – source file
source_folder (str) – a source folder path
dest_path (b2sdk.v1.AbstractSyncPath) – destination file
dest_folder (str) – a destination folder path
now_millis (int) – current time in milliseconds
delete (bool) – delete policy
keep_days (int) – keep for days policy
newer_file_mode (b2sdk.v1.NewerFileSyncMode) – setting which determines handling for destination files newer than on the source
compare_threshold (int) – difference between file modification time or file size
compare_version_mode (b2sdk.v1.CompareVersionMode) – setting which determines how to compare source and destination files
encryption_settings_provider (b2sdk.v1.AbstractSyncEncryptionSettingsProvider) – an object which decides which encryption to use (if any)
- Returns
a policy object
-