at master 4.6 kB view raw
1diff --git a/rclone_python/rclone.py b/rclone_python/rclone.py 2index da399b4..e05365a 100644 3--- a/rclone_python/rclone.py 4+++ b/rclone_python/rclone.py 5@@ -43,7 +43,7 @@ def is_installed() -> bool: 6 """ 7 :return: True if rclone is correctly installed on the system. 8 """ 9- return which("rclone") is not None 10+ return True 11 12 13 @__check_installed 14@@ -199,7 +199,7 @@ def copy( 15 in_path, 16 out_path, 17 ignore_existing=ignore_existing, 18- command="rclone copy", 19+ command="@rclone@ copy", 20 command_descr="Copying", 21 show_progress=show_progress, 22 listener=listener, 23@@ -234,7 +234,7 @@ def copyto( 24 in_path, 25 out_path, 26 ignore_existing=ignore_existing, 27- command="rclone copyto", 28+ command="@rclone@ copyto", 29 command_descr="Copying", 30 show_progress=show_progress, 31 listener=listener, 32@@ -269,7 +269,7 @@ def move( 33 in_path, 34 out_path, 35 ignore_existing=ignore_existing, 36- command="rclone move", 37+ command="@rclone@ move", 38 command_descr="Moving", 39 show_progress=show_progress, 40 listener=listener, 41@@ -304,7 +304,7 @@ def moveto( 42 in_path, 43 out_path, 44 ignore_existing=ignore_existing, 45- command="rclone moveto", 46+ command="@rclone@ moveto", 47 command_descr="Moving", 48 show_progress=show_progress, 49 listener=listener, 50@@ -336,7 +336,7 @@ def sync( 51 _rclone_transfer_operation( 52 src_path, 53 dest_path, 54- command="rclone sync", 55+ command="@rclone@ sync", 56 command_descr="Syncing", 57 show_progress=show_progress, 58 listener=listener, 59diff --git a/rclone_python/scripts/get_version.py b/rclone_python/scripts/get_version.py 60index b1d30fd..bc00cad 100644 61--- a/rclone_python/scripts/get_version.py 62+++ b/rclone_python/scripts/get_version.py 63@@ -2,6 +2,6 @@ from subprocess import check_output 64 65 66 def get_version(): 67- stdout = check_output("rclone version", shell=True, encoding="utf8") 68+ stdout = check_output("@rclone@ version", shell=True, encoding="utf8") 69 70 return stdout.split("\n")[0].replace("rclone ", "") 71diff --git a/rclone_python/scripts/update_hash_types.py b/rclone_python/scripts/update_hash_types.py 72index 92fbd0a..ef963cf 100644 73--- a/rclone_python/scripts/update_hash_types.py 74+++ b/rclone_python/scripts/update_hash_types.py 75@@ -14,7 +14,7 @@ def update_hashes(output_path: str): 76 """ 77 78 # get all supported backends 79- rclone_output = sp.check_output("rclone hashsum", shell=True, encoding="utf8") 80+ rclone_output = sp.check_output("@rclone@ hashsum", shell=True, encoding="utf8") 81 lines = rclone_output.splitlines() 82 83 hashes = [] 84diff --git a/rclone_python/utils.py b/rclone_python/utils.py 85index d4a8413..1b29bd8 100644 86--- a/rclone_python/utils.py 87+++ b/rclone_python/utils.py 88@@ -66,9 +66,9 @@ def run_rclone_cmd( 89 # otherwise the default rclone config path is used: 90 config = Config() 91 if config.config_path is not None: 92- base_command = f"rclone --config={config.config_path}" 93+ base_command = f"@rclone@ --config={config.config_path}" 94 else: 95- base_command = "rclone" 96+ base_command = "@rclone@" 97 98 # add optional arguments and flags to the command 99 args_str = args2string(args) 100diff --git a/tests/test_copy.py b/tests/test_copy.py 101index 4ded5fa..1cae53b 100644 102--- a/tests/test_copy.py 103+++ b/tests/test_copy.py 104@@ -45,11 +45,11 @@ def create_local_file( 105 @pytest.mark.parametrize( 106 "wrapper_command,rclone_command", 107 [ 108- (rclone.copy, "rclone copy"), 109- (rclone.copyto, "rclone copyto"), 110- (rclone.sync, "rclone sync"), 111- (rclone.move, "rclone move"), 112- (rclone.moveto, "rclone moveto"), 113+ (rclone.copy, "@rclone@ copy"), 114+ (rclone.copyto, "@rclone@ copyto"), 115+ (rclone.sync, "@rclone@ sync"), 116+ (rclone.move, "@rclone@ move"), 117+ (rclone.moveto, "@rclone@ moveto"), 118 ], 119 ) 120 def test_rclone_command_called(wrapper_command: Callable, rclone_command: str): 121@@ -62,7 +62,7 @@ def test_rclone_command_called(wrapper_command: Callable, rclone_command: str): 122 rclone.utils.subprocess, 123 "Popen", 124 return_value=subprocess.Popen( 125- "rclone help", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True 126+ "@rclone@ help", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True 127 ), 128 ) as mock: 129 wrapper_command("nothing/not_a.file", "fake_remote:unicorn/folder")