summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/actions.py29
-rw-r--r--ranger/fsobject/loader.py9
2 files changed, 21 insertions, 17 deletions
diff --git a/ranger/actions.py b/ranger/actions.py
index 08495ce8..3dac209f 100644
--- a/ranger/actions.py
+++ b/ranger/actions.py
@@ -188,36 +188,31 @@ class Actions(EnvironmentAware, SettingsAware):
 	def paste(self):
 		"""Paste the selected items into the current directory"""
 		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
 
 		if not copied_files:
 			return
 
 		if self.env.cut:
-			msg = self.notify("Moving ...", duration=0)
-			self.ui.redraw()
 			for f in self.env.copy:
-				try:
-					shutil.move(f.path, self.env.pwd.path)
-				except (shutil.Error, IOError, OSError) as x:
-					self.notify(str(x), bad=True)
+				self.loader.add(LoadableObject(\
+						shutil_g.move(f.path, self.env.pwd.path),\
+						"moving: " + f.path))
 			self.env.copy.clear()
 			self.env.cut = False
 		else:
-			msg = self.notify("Copying ...", duration=0)
-			self.ui.redraw()
 			for f in self.env.copy:
 				if isdir(f.path):
-					try:
-						shutil.copytree(f.path, join(self.env.pwd.path, f.basename))
-					except (shutil.Error, IOError, OSError) as x:
-						self.notify(str(x), bad=True)
+					self.loader.add(LoadableObject(
+						shutil_g.copytree(f.path,
+							join(self.env.pwd.path, f.basename)),
+						"copying tree: " + str(f.path)))
 				else:
-					try:
-						shutil.copy(f.path, self.env.pwd.path)
-					except (shutil.Error, IOError, OSError) as x:
-						self.notify(str(x), bad=True)
-		msg.delete()
+					self.loader.add(LoadableObject(
+						shutil_g.copy2(f.path, self.env.pwd.path),
+						"copying: " + str(f.path)))
 
 		self.env.pwd.load_content()
 
diff --git a/ranger/fsobject/loader.py b/ranger/fsobject/loader.py
index 7b051d53..aaf38117 100644
--- a/ranger/fsobject/loader.py
+++ b/ranger/fsobject/loader.py
@@ -11,6 +11,15 @@ def status_generator():
 		yield '\\'
 		yield '|'
 
+class LoadableObject(object):
+	def __init__(self, gen, descr):
+		self.load_generator = gen
+		self.description = descr
+
+	def get_description(self):
+		return self.description
+
+
 class Loader(object):
 	seconds_of_work_time = 0.05
 
31' href='#n131'>131 132 133 134 135 136 137 138 139 140 141 142 143 144
145
146
147
148
149