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