1 | #!/usr/bin/env python3 |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
2 | # -*- coding: future_fstrings -*- |
||
3 | |||
4 | from db_sync_tool.utility import system |
||
5 | from db_sync_tool.database import process |
||
6 | from file_sync_tool.utility import info, helper |
||
7 | from file_sync_tool.transfer import process |
||
0 ignored issues
–
show
|
|||
8 | |||
9 | |||
10 | class Sync: |
||
11 | """ |
||
12 | Synchronize target files from an origin system |
||
13 | """ |
||
14 | |||
15 | def __init__(self, |
||
0 ignored issues
–
show
|
|||
16 | config_file=None, |
||
17 | verbose=False, |
||
18 | mute=False, |
||
19 | host_file=None, |
||
20 | config=None, |
||
21 | args=None): |
||
22 | """ |
||
23 | Initialization |
||
24 | :param config_file: |
||
25 | :param verbose: |
||
26 | :param mute: |
||
27 | :param host_file: |
||
28 | :param config: |
||
29 | :param args: |
||
30 | """ |
||
31 | info.print_header(mute) |
||
32 | system.check_args_options( |
||
33 | config_file=config_file, |
||
34 | host_file=host_file, |
||
35 | verbose=verbose, |
||
36 | mute=mute |
||
37 | ) |
||
38 | system.get_configuration(config, None) |
||
39 | # workaround for extending config with args |
||
40 | system.config=helper.extend_config(args) |
||
0 ignored issues
–
show
|
|||
41 | helper.adjust_sync_mode() |
||
42 | helper.check_rsync_version() |
||
43 | helper.check_sshpass_version() |
||
44 | helper.check_authorizations() |
||
45 | process.transfer_files() |
||
46 | info.print_footer() |
||
47 |