summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2015-07-15 00:06:02 +0200
committerhut <hut@lepus.uberspace.de>2015-07-15 00:15:50 +0200
commit442e731f188daf7722bbb2791a7a58e4496d190b (patch)
tree54a77f52b6886d753445b9ae23128c7431fbe216 /ranger
parentfd187b46fb02cf20fae98bebe65ade5e35073fa9 (diff)
downloadranger-442e731f188daf7722bbb2791a7a58e4496d190b.tar.gz
rc.conf: added pP/pO keys for FIFO-queued copying, fixes #345
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/rc.conf2
-rw-r--r--ranger/core/actions.py5
-rw-r--r--ranger/core/loader.py10
3 files changed, 13 insertions, 4 deletions
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index f34b6e0c..bb9af151 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -344,6 +344,8 @@ map I  eval fm.open_console('rename ' + fm.thisfile.relative_path, position=7)
 
 map pp paste
 map po paste overwrite=True
+map pP paste append=True
+map pO paste overwrite=True append=True
 map pl paste_symlink relative=False
 map pL paste_symlink relative=True
 map phl paste_hardlink
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 442182ff..e3dba313 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1217,9 +1217,10 @@ class Actions(FileManagerAware, SettingsAware):
                 link(source_path,
                     next_available_filename(target_path))
 
-    def paste(self, overwrite=False):
+    def paste(self, overwrite=False, append=False):
         """Paste the selected items into the current directory"""
-        self.loader.add(CopyLoader(self.copy_buffer, self.do_cut, overwrite))
+        loadable = CopyLoader(self.copy_buffer, self.do_cut, overwrite)
+        self.loader.add(loadable, append=append)
         self.do_cut = False
 
     def delete(self):
diff --git a/ranger/core/loader.py b/ranger/core/loader.py
index 8eda544f..f4694eca 100644
--- a/ranger/core/loader.py
+++ b/ranger/core/loader.py
@@ -275,14 +275,20 @@ class Loader(FileManagerAware):
             (self.throbber_status + 1) % len(self.throbber_chars)
         self.status = self.throbber_chars[self.throbber_status]
 
-    def add(self, obj):
+    def add(self, obj, append=False):
         """Add an object to the queue.
 
         It should have a load_generator method.
+
+        If the argument "append" is True, the queued object will be processed
+        last, not first.
         """
         while obj in self.queue:
             self.queue.remove(obj)
-        self.queue.appendleft(obj)
+        if append:
+            self.queue.append(obj)
+        else:
+            self.queue.appendleft(obj)
         if self.paused:
             obj.pause()
         else:
00:10:49 +0100 updated pydoc documentation' href='/akspecs/ranger/commit/doc/pydoc/ranger.gui.defaultui.html?h=v1.2.2&id=4c13e1f2d85483e026d79ab05da9f1e8e4b45293'>4c13e1f2 ^
f07bb12f ^


4c13e1f2 ^
f07bb12f ^







4c13e1f2 ^
f07bb12f ^
4c13e1f2 ^

f07bb12f ^



f07bb12f ^















4c13e1f2 ^











f07bb12f ^
4c13e1f2 ^
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179