summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/actions.py49
1 files changed, 32 insertions, 17 deletions
diff --git a/ranger/actions.py b/ranger/actions.py
index 3dac209f..7a1215df 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -190,31 +190,46 @@ class Actions(EnvironmentAware, SettingsAware):
 		from os.path import join, isdir
 		from ranger.ext import shutil_generatorized as shutil_g
 		from ranger.fsobject.loader import LoadableObject
-		copied_files = self.env.copy
+		copied_files = tuple(self.env.copy)
 
 		if not copied_files:
 			return
 
+		pwd = self.env.pwd
+		try:
+			one_file = copied_files[0]
+		except:
+			one_file = None
+
 		if self.env.cut:
-			for f in self.env.copy:
-				self.loader.add(LoadableObject(\
-						shutil_g.move(f.path, self.env.pwd.path),\
-						"moving: " + f.path))
 			self.env.copy.clear()
 			self.env.cut = False
+			if len(copied_files) == 1:
+				descr = "moving: " + one_file.path
+			else:
+				descr = "moving files from: " + one_file.dirname
+			def generate():
+				for f in copied_files:
+					for _ in shutil_g.move(f.path, pwd.path):
+						yield
+				pwd.load_content()
 		else:
-			for f in self.env.copy:
-				if isdir(f.path):
-					self.loader.add(LoadableObject(
-						shutil_g.copytree(f.path,
-							join(self.env.pwd.path, f.basename)),
-						"copying tree: " + str(f.path)))
-				else:
-					self.loader.add(LoadableObject(
-						shutil_g.copy2(f.path, self.env.pwd.path),
-						"copying: " + str(f.path)))
-
-		self.env.pwd.load_content()
+			if len(copied_files) == 1:
+				descr = "copying: " + one_file.path
+			else:
+				descr = "copying files from: " + one_file.dirname
+			def generate():
+				for f in self.env.copy:
+					if isdir(f.path):
+						for _ in shutil_g.copytree(f.path,
+								join(self.env.pwd.path, f.basename)):
+							yield
+					else:
+						for _ in shutil_g.copy2(f.path, self.env.pwd.path):
+							yield
+				pwd.load_content()
+
+		self.loader.add(LoadableObject(generate(), descr))
 
 	def delete(self):
 		msg = self.notify("Deleting ...", duration=0)
oid'>f07bb12f ^
34a60763 ^
f07bb12f ^









34a60763 ^
f07bb12f ^





34a60763 ^
f07bb12f ^









34a60763 ^
f07bb12f ^

4c13e1f2 ^

f07bb12f ^










34a60763 ^
f07bb12f ^






















62cd83ba ^
f07bb12f ^
f07bb12f ^








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