about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2015-10-28 04:29:47 +0100
committernfnty <git@nfnty.se>2016-02-08 04:43:04 +0100
commit5b14517afec332127610a087f0717f7f96b96b37 (patch)
treecb82e139a0db41694ccd92f2c01608a7cb0be6b3
parent87e473e0921f05b5e66f84d5bdc9e810a65218cc (diff)
downloadranger-5b14517afec332127610a087f0717f7f96b96b37.tar.gz
VCS: Fix python2 compatibility
-rw-r--r--AUTHORS2
-rw-r--r--ranger/ext/vcs/bzr.py6
-rw-r--r--ranger/ext/vcs/git.py6
-rw-r--r--ranger/ext/vcs/hg.py6
-rw-r--r--ranger/ext/vcs/svn.py9
-rw-r--r--ranger/ext/vcs/vcs.py39
6 files changed, 24 insertions, 44 deletions
diff --git a/AUTHORS b/AUTHORS
index ec17affb..d3789119 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -21,6 +21,8 @@ Copyright 2015  Delisa Mason <iskanamagus@gmail.com>
 Copyright 2015  No Suck <admin@nosuck.org>
 Copyright 2015  Randy Nance <randynobx@gmail.com>
 Copyright 2015  Wojciech Siewierski <wojciech.siewierski@onet.pl>
+Copyright 2015  Ryan Burns <rdburns@gmail.com>
+Copyright 2015  nfnty <git@nfnty.se>
 
 Ideally, all contributors of non-trivial code are named here to the extent that
 a name and e-mail address is available.  Please write a mail to hut@hut.pm if
diff --git a/ranger/ext/vcs/bzr.py b/ranger/ext/vcs/bzr.py
index 8e9f44d3..7b870d7d 100644
--- a/ranger/ext/vcs/bzr.py
+++ b/ranger/ext/vcs/bzr.py
@@ -1,8 +1,4 @@
-# This file is part of ranger, the console file manager.
-# License: GNU GPL version 3, see the file "AUTHORS" for details.
-# Author: Abdó Roig-Maranges <abdo.roig@gmail.com>, 2012
-#
-# vcs - a python module to handle various version control systems
+"""GNU Bazaar module"""
 
 import os
 import re
diff --git a/ranger/ext/vcs/git.py b/ranger/ext/vcs/git.py
index b7c51fa6..ab971423 100644
--- a/ranger/ext/vcs/git.py
+++ b/ranger/ext/vcs/git.py
@@ -1,8 +1,4 @@
-# This file is part of ranger, the console file manager.
-# License: GNU GPL version 3, see the file "AUTHORS" for details.
-# Author: Abdó Roig-Maranges <abdo.roig@gmail.com>, 2011-2012
-#
-# vcs - a python module to handle various version control systems
+"""Git module"""
 
 import os
 import re
diff --git a/ranger/ext/vcs/hg.py b/ranger/ext/vcs/hg.py
index 77587408..48e991bf 100644
--- a/ranger/ext/vcs/hg.py
+++ b/ranger/ext/vcs/hg.py
@@ -1,8 +1,4 @@
-# This file is part of ranger, the console file manager.
-# License: GNU GPL version 3, see the file "AUTHORS" for details.
-# Author: Abdó Roig-Maranges <abdo.roig@gmail.com>, 2011-2012
-#
-# vcs - a python module to handle various version control systems
+"""Mercurial module"""
 
 import os
 import re
diff --git a/ranger/ext/vcs/svn.py b/ranger/ext/vcs/svn.py
index 9868b5fd..f7e4bbf4 100644
--- a/ranger/ext/vcs/svn.py
+++ b/ranger/ext/vcs/svn.py
@@ -1,11 +1,4 @@
-# This file is part of ranger, the console file manager.
-# License: GNU GPL version 3, see the file "AUTHORS" for details.
-# Author: Abdó Roig-Maranges <abdo.roig@gmail.com>, 2011-2012
-#         Ryan Burns <rdburns@gmail.com>, 2015
-#
-# R. Burns start with Abdó's Hg module and modified it for Subversion.
-#
-# vcs - a python module to handle various version control systems
+"""Subversion module"""
 
 from __future__ import with_statement
 import os
diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py
index a6d12db7..2ea2773e 100644
--- a/ranger/ext/vcs/vcs.py
+++ b/ranger/ext/vcs/vcs.py
@@ -1,9 +1,4 @@
-# This file is part of ranger, the console file manager.
-# License: GNU GPL version 3, see the file "AUTHORS" for details.
-# Author: Abdó Roig-Maranges <abdo.roig@gmail.com>, 2011-2012
-#
-# vcs - a python module to handle various version control systems
-"""Vcs module"""
+"""VCS module"""
 
 import os
 import subprocess
@@ -14,22 +9,23 @@ class VcsError(Exception):
     pass
 
 class Vcs(object):
-    """ This class represents a version controlled path, abstracting the usual
-        operations from the different supported backends.
+    """
+    This class represents a version controlled path, abstracting the usual
+    operations from the different supported backends.
 
-        The backends are declared in te variable self.repo_types, and are derived
-        classes from Vcs with the following restrictions:
+    The backends are declared in te variable self.repo_types, and are derived
+    classes from Vcs with the following restrictions:
 
-         * do NOT implement __init__. Vcs takes care of this.
+     * do NOT implement __init__. Vcs takes care of this.
 
-         * do not create change internal state. All internal state should be
-           handled in Vcs
+     * do not create change internal state. All internal state should be
+       handled in Vcs
 
-        Objects from backend classes should never be created directly. Instead
-        create objects of Vcs class. The initialization calls update, which takes
-        care of detecting the right Vcs backend to use and dynamically changes the
-        object type accordingly.
-        """
+    Objects from backend classes should never be created directly. Instead
+    create objects of Vcs class. The initialization calls update, which takes
+    care of detecting the right Vcs backend to use and dynamically changes the
+    object type accordingly.
+    """
 
     # These are abstracted revs, representing the current index (staged files),
     # the current head and nothing. Every backend should redefine them if the
@@ -206,7 +202,7 @@ class Vcs(object):
                         fileobj.vcspathstatus = wroot_obj.vcs.get_status_subpath(fileobj.path)
 
             # Remove dead directories
-            for wdir in wdirs.copy():
+            for wdir in list(wdirs):
                 try:
                     wdir_obj = self.obj.fm.directories[os.path.join(wroot, wdir)]
                 except KeyError:
@@ -218,7 +214,7 @@ class Vcs(object):
     def update_tree(self, purge=False):
         """Update tree"""
         self._update_walk(self.root, purge)
-        for path in self.rootvcs.links.copy():
+        for path in list(self.rootvcs.links):
             self._update_walk(path, purge)
             try:
                 dirobj = self.obj.fm.directories[path]
@@ -355,7 +351,8 @@ class Vcs(object):
 class VcsThread(threading.Thread):
     """Vcs thread"""
     def __init__(self, ui, idle_delay):
-        super(VcsThread, self).__init__(daemon=True)
+        super(VcsThread, self).__init__()
+        self.daemon = True
         self.ui = ui
         self.delay = idle_delay / 1000
         self.wake = threading.Event()
ry/Implementation/HTVMS_WaisProt.h?id=18024037b515bfff83e0230b35151babe6005e18'>^
e087f6d4


d3f9d547 ^


e087f6d4
d3f9d547 ^
e087f6d4





d3f9d547 ^
e087f6d4
d3f9d547 ^
e087f6d4
d3f9d547 ^


e087f6d4
d3f9d547 ^
e087f6d4

d3f9d547 ^


e087f6d4
d3f9d547 ^
e087f6d4

d3f9d547 ^

















e087f6d4

































0bafa3a3 ^
d3f9d547 ^
0bafa3a3 ^

d3f9d547 ^

e087f6d4
































d3f9d547 ^


e087f6d4



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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396