diff options
author | hut <hut@lavabit.com> | 2010-05-15 23:37:16 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-05-15 23:37:16 +0200 |
commit | 572e74f28c63a2dce6268e0be3ec3df10ac58312 (patch) | |
tree | 0a0af893cfacf0d1710c76653a5ab7d6dfe41f89 /ranger | |
parent | 35b72f662d50dab160dbb32705f32d34762765a1 (diff) | |
download | ranger-572e74f28c63a2dce6268e0be3ec3df10ac58312.tar.gz |
core.actions: improved paste()
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/core/actions.py | 11 | ||||
-rw-r--r-- | ranger/core/loader.py | 7 |
2 files changed, 12 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index c61ef338..16978591 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -569,10 +569,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): cwd.load_content() original_path = self.env.cwd.path - try: - one_file = copied_files[0] - except: - one_file = None + one_file = copied_files[0] if self.env.cut: self.env.copy.clear() @@ -582,7 +579,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): else: descr = "moving files from: " + one_file.dirname obj = CommandLoader(args=['mv', '--backup=existing', - '-t', self.env.cwd.path] + [f.path for f in copied_files], + '--suffix=_', '-ft', self.env.cwd.path] + \ + [f.path for f in copied_files], descr=descr, end_hook=refresh) else: if len(copied_files) == 1: @@ -590,7 +588,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): else: descr = "copying files from: " + one_file.dirname obj = CommandLoader(args=['cp', '--backup=existing', '--archive', - '-t', self.env.cwd.path] + [f.path for f in self.env.copy], + '--suffix=_', '-frt', self.env.cwd.path] + \ + [f.path for f in self.env.copy], descr=descr, end_hook=refresh) self.loader.add(obj) diff --git a/ranger/core/loader.py b/ranger/core/loader.py index ad6864e2..e5a136d0 100644 --- a/ranger/core/loader.py +++ b/ranger/core/loader.py @@ -54,6 +54,13 @@ class Loadable(object): class CommandLoader(Loadable, FileManagerAware): + """ + Run an external command with the loader. + + Output from stderr will be reported. Ensure that the process doesn't + ever ask for input, otherwise the loader will be blocked until this + object is removed from the queue (type ^C in ranger) + """ finished = False def __init__(self, args, descr, begin_hook=None, end_hook=None): Loadable.__init__(self, self.generate(), descr) |