diff --git a/src/unisync/synchroniser.py b/src/unisync/synchroniser.py index 8a39e44..222fc7d 100644 --- a/src/unisync/synchroniser.py +++ b/src/unisync/synchroniser.py @@ -150,7 +150,9 @@ class Synchroniser: ) def sync(self, remote_root:str, local_root:str, - paths:list=[], ignore:list=[], force:bool=False) -> int: + paths:list=[], ignore:list=[], force:bool=False, + other:list=[] + ) -> int: """Performs the synchronisation by calling unison. Args: @@ -162,6 +164,12 @@ class Synchroniser: If you need to ignore some specific files use the arguments. force: Force all changes from remote to local. Used mostly when replacing a link by the file. + other: + Other arguments to add to unison. + These arguments will only be used for this sync which is not + the case for the ones in self.args_bool and self.args_value. + They will be added to the command as is no - in front. + For exemple backups are implemented using this argument. Returns: the unison return code see section 6.11 of the documentation @@ -192,6 +200,9 @@ class Synchroniser: command.append(remote_root) command.append("-batch") + for arg in other: + command.append(arg) + proc = subprocess.Popen(command) ret_code = proc.wait() return ret_code