summary refs log tree commit diff stats
path: root/ranger/core/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r--ranger/core/actions.py53
1 files changed, 3 insertions, 50 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 3fef3db3..c8964157 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -22,8 +22,7 @@ from ranger.core.shared import FileManagerAware, EnvironmentAware, \
 		SettingsAware
 from ranger.core.tab import Tab
 from ranger.fsobject import File
-from ranger.core.loader import CommandLoader, Loadable
-from ranger.ext import shutil_generatorized as shutil_g
+from ranger.core.loader import CommandLoader, CopyLoader
 
 MACRO_FAIL = "<\x01\x01MACRO_HAS_NO_VALUE\x01\01>"
 
@@ -1062,54 +1061,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 
 	def paste(self, overwrite=False):
 		"""Paste the selected items into the current directory"""
-		copied_files = tuple(self.copy_buffer)
-
-		if not copied_files:
-			return
-
-		original_path = self.thistab.path
-		try:
-			one_file = copied_files[0]
-		except:
-			one_file = None
-
-		if self.do_cut:
-			self.copy_buffer.clear()
-			self.do_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(src=f.path,
-							dst=original_path,
-							overwrite=overwrite):
-						yield
-				cwd = self.get_directory(original_path)
-				cwd.load_content()
-		else:
-			if len(copied_files) == 1:
-				descr = "copying: " + one_file.path
-			else:
-				descr = "copying files from: " + one_file.dirname
-			def generate():
-				for f in self.copy_buffer:
-					if isdir(f.path):
-						for _ in shutil_g.copytree(src=f.path,
-								dst=join(original_path, f.basename),
-								symlinks=True,
-								overwrite=overwrite):
-							yield
-					else:
-						for _ in shutil_g.copy2(f.path, original_path,
-								symlinks=True,
-								overwrite=overwrite):
-							yield
-				cwd = self.get_directory(original_path)
-				cwd.load_content()
-
-		self.loader.add(Loadable(generate(), descr))
+		self.loader.add(CopyLoader(self.copy_buffer, self.do_cut, overwrite))
+		self.do_cut = False
 
 	def delete(self):
 		# XXX: warn when deleting mount points/unseen marked files?
} /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
dwm - dynamic window manager
----------------------------

dwm is an extremly fast, small, and dynamic X11 window manager.


Requirements
------------
In order to build dwm you need the Xlib header files.


Installation
------------
Edit config.mk to match your local setup. dwm is installed into
the /usr/local namespace by default.

Afterwards enter the following command to build and install dwm (if
necessary as root):

    make clean install


Running dwm
-----------
Add the following line to your .xinitrc to start dwm using startx:

    exec dwm

In order to connect dwm to a specific display, make sure that
the DISPLAY environment variable is set correctly, e.g.:

    DISPLAY=foo.bar:1 exec dwm

This will start dwm on display :1 of the host foo.bar.


Configuration
-------------
The configuration of dwm is done by customizing the wm.h source file. To
customize the key bindings edit dev.c.