runners, main : pass the config to the runners

Some of the runners need the configuration to perform their task.
So pass it to all of them and edit the call in main to reflect this
change.
This commit is contained in:
2026-01-08 13:53:37 +01:00
parent 2ae9c38627
commit 56da79f124
2 changed files with 5 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ def main():
paths_manager = PathsManager(Path(config.roots.local), config.other.cache_dir_path) paths_manager = PathsManager(Path(config.roots.local), config.other.cache_dir_path)
cli_args.func(synchroniser, paths_manager) cli_args.func(synchroniser, paths_manager, config)
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -3,9 +3,9 @@
from unisync.synchroniser import Synchroniser from unisync.synchroniser import Synchroniser
from unisync.paths import PathsManager from unisync.paths import PathsManager
from unisync.config import Config
def unisync_sync(synchroniser:Synchroniser, paths_manager:PathsManager, config: Config):
def unisync_sync(synchroniser:Synchroniser, paths_manager:PathsManager):
if synchroniser.create_ssh_master_connection() != 0: if synchroniser.create_ssh_master_connection() != 0:
print("Connection failed quitting") print("Connection failed quitting")
return 1 return 1
@@ -21,7 +21,7 @@ def unisync_sync(synchroniser:Synchroniser, paths_manager:PathsManager):
synchroniser.close_ssh_master_connection() synchroniser.close_ssh_master_connection()
def unisync_add(synchroniser:Synchroniser, paths_manager:PathsManager): def unisync_add(synchroniser:Synchroniser, paths_manager:PathsManager, config: Config):
if synchroniser.create_ssh_master_connection() != 0: if synchroniser.create_ssh_master_connection() != 0:
print("Connection failed quitting") print("Connection failed quitting")
return 1 return 1
@@ -32,5 +32,5 @@ def unisync_add(synchroniser:Synchroniser, paths_manager:PathsManager):
synchroniser.close_ssh_master_connection() synchroniser.close_ssh_master_connection()
def unisync_mount(synchroniser:Synchroniser, paths_manager:PathsManager): def unisync_mount(synchroniser:Synchroniser, paths_manager:PathsManager, config: Config):
synchroniser.mount_remote_dir() synchroniser.mount_remote_dir()