Merge lp:~mgorse/duplicity/0.8-series into lp:~duplicity-team/duplicity/0.8-series

Proposed by Mgorse
Status: Merged
Merged at revision: 1339
Proposed branch: lp:~mgorse/duplicity/0.8-series
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 385 lines (+46/-37)
19 files modified
bin/duplicity (+3/-3)
bin/rdiffdir (+2/-1)
duplicity/backend.py (+2/-2)
duplicity/backends/adbackend.py (+1/-0)
duplicity/backends/dpbxbackend.py (+7/-6)
duplicity/backends/gdocsbackend.py (+1/-0)
duplicity/backends/megabackend.py (+1/-0)
duplicity/backends/onedrivebackend.py (+1/-0)
duplicity/backends/pyrax_identity/hubic.py (+4/-3)
duplicity/backends/rsyncbackend.py (+2/-1)
duplicity/collections.py (+1/-1)
duplicity/diffdir.py (+1/-1)
duplicity/dup_time.py (+2/-2)
duplicity/gpg.py (+4/-4)
duplicity/librsync.py (+1/-1)
po/duplicity.pot (+3/-3)
testing/functional/__init__.py (+6/-5)
testing/unit/test_dup_time.py (+2/-2)
testing/unit/test_manifest.py (+2/-2)
To merge this branch: bzr merge lp:~mgorse/duplicity/0.8-series
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+356627@code.launchpad.net

Commit message

Run futurize --stage1, and adjust so that tests still pass.

To post a comment you must log in.
lp:~mgorse/duplicity/0.8-series updated
1339. By Kenneth Loafman

* Merged in lp:~mgorse/duplicity/0.8-series
  - Run futurize --stage1, and adjust so that tests still pass.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/duplicity'
2--- bin/duplicity 2018-09-06 11:14:11 +0000
3+++ bin/duplicity 2018-10-12 01:45:30 +0000
4@@ -222,7 +222,7 @@
5 """
6 try:
7 # Just spin our wheels
8- while tarblock_iter.next():
9+ while next(tarblock_iter):
10 pass
11 except StopIteration:
12 pass
13@@ -247,7 +247,7 @@
14 last_block = globals.restart.last_block
15 try:
16 # Just spin our wheels
17- iter_result = tarblock_iter.next()
18+ iter_result = next(tarblock_iter)
19 while iter_result:
20 if (tarblock_iter.previous_index == last_index):
21 # If both the previous index and this index are done, exit now
22@@ -266,7 +266,7 @@
23 # We went too far! Stuff the data back into place before restarting
24 tarblock_iter.queue_index_data(iter_result)
25 break
26- iter_result = tarblock_iter.next()
27+ iter_result = next(tarblock_iter)
28 except StopIteration:
29 log.Warn(_(u"File %s missing in backup set.\n"
30 u"Continuing restart on file %s.") %
31
32=== modified file 'bin/rdiffdir'
33--- bin/rdiffdir 2018-07-22 14:36:15 +0000
34+++ bin/rdiffdir 2018-10-12 01:45:30 +0000
35@@ -25,6 +25,7 @@
36 # Please send mail to me or the mailing list if you find bugs or have
37 # any suggestions.
38
39+from __future__ import print_function
40 import sys
41 import getopt
42 import gzip
43@@ -97,7 +98,7 @@
44 elif opt == u"--null-separator":
45 globals.null_separator = 1
46 elif opt == u"-V":
47- print u"rdiffdir", str(globals.version)
48+ print(u"rdiffdir", str(globals.version))
49 sys.exit(0)
50 elif opt == u"-v" or opt == u"--verbosity":
51 log.setverbosity(int(arg))
52
53=== modified file 'duplicity/backend.py'
54--- duplicity/backend.py 2018-09-11 21:35:37 +0000
55+++ duplicity/backend.py 2018-10-12 01:45:30 +0000
56@@ -477,7 +477,7 @@
57 """
58 import shlex
59
60- if isinstance(commandline, (types.ListType, types.TupleType)):
61+ if isinstance(commandline, (list, tuple)):
62 logstr = u' '.join(commandline)
63 args = commandline
64 else:
65@@ -583,7 +583,7 @@
66 u"""
67 Delete each filename in filename_list, in order if possible.
68 """
69- assert not isinstance(filename_list, types.StringType)
70+ assert not isinstance(filename_list, bytes)
71 if hasattr(self.backend, u'_delete_list'):
72 self._do_delete_list(filename_list)
73 elif hasattr(self.backend, u'_delete'):
74
75=== modified file 'duplicity/backends/adbackend.py'
76--- duplicity/backends/adbackend.py 2018-07-23 14:55:39 +0000
77+++ duplicity/backends/adbackend.py 2018-10-12 01:45:30 +0000
78@@ -1,3 +1,4 @@
79+from __future__ import print_function
80 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
81 #
82 # Copyright 2016 Stefan Breunig <stefan-duplicity@breunig.xyz>
83
84=== modified file 'duplicity/backends/dpbxbackend.py'
85--- duplicity/backends/dpbxbackend.py 2018-10-04 14:46:47 +0000
86+++ duplicity/backends/dpbxbackend.py 2018-10-12 01:45:30 +0000
87@@ -1,3 +1,4 @@
88+from __future__ import print_function
89 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
90 #
91 # Copyright 2013 jno <jno@pisem.net>
92@@ -148,12 +149,12 @@
93 auth_flow = DropboxOAuth2FlowNoRedirect(app_key, app_secret)
94 log.Debug(u'dpbx,auth_flow.start()')
95 authorize_url = auth_flow.start()
96- print
97- print u'-' * 72
98- print u"1. Go to: " + authorize_url
99- print u"2. Click \"Allow\" (you might have to log in first)."
100- print u"3. Copy the authorization code."
101- print u'-' * 72
102+ print()
103+ print(u'-' * 72)
104+ print(u"1. Go to: " + authorize_url)
105+ print(u"2. Click \"Allow\" (you might have to log in first).")
106+ print(u"3. Copy the authorization code.")
107+ print(u'-' * 72)
108 auth_code = raw_input(u"Enter the authorization code here: ").strip()
109 try:
110 log.Debug(u'dpbx,auth_flow.finish(%s)' % auth_code)
111
112=== modified file 'duplicity/backends/gdocsbackend.py'
113--- duplicity/backends/gdocsbackend.py 2018-07-23 14:55:39 +0000
114+++ duplicity/backends/gdocsbackend.py 2018-10-12 01:45:30 +0000
115@@ -1,3 +1,4 @@
116+from __future__ import print_function
117 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
118 #
119 # Copyright 2011 Carlos Abalde <carlos.abalde@gmail.com>
120
121=== modified file 'duplicity/backends/megabackend.py'
122--- duplicity/backends/megabackend.py 2018-07-23 14:55:39 +0000
123+++ duplicity/backends/megabackend.py 2018-10-12 01:45:30 +0000
124@@ -1,3 +1,4 @@
125+from __future__ import print_function
126 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
127 #
128 # Copyright 2017 Tomas Vondra (Launchpad id: tomas-v)
129
130=== modified file 'duplicity/backends/onedrivebackend.py'
131--- duplicity/backends/onedrivebackend.py 2018-07-23 14:55:39 +0000
132+++ duplicity/backends/onedrivebackend.py 2018-10-12 01:45:30 +0000
133@@ -1,3 +1,4 @@
134+from __future__ import print_function
135 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
136 # vim:tabstop=4:shiftwidth=4:expandtab
137 #
138
139=== modified file 'duplicity/backends/pyrax_identity/hubic.py'
140--- duplicity/backends/pyrax_identity/hubic.py 2018-07-23 14:55:39 +0000
141+++ duplicity/backends/pyrax_identity/hubic.py 2018-10-12 01:45:30 +0000
142@@ -3,6 +3,7 @@
143 # Copyright (c) 2014 Gu1
144 # Licensed under the MIT license
145
146+from __future__ import print_function
147 import ConfigParser
148 import os
149 import re
150@@ -122,12 +123,12 @@
151 config.remove_option(u"hubic", u"email")
152 with open(TOKENS_FILE, u'wb') as configfile:
153 config.write(configfile)
154- print u"username has been removed from the .hubic_tokens file sent to the CE."
155+ print(u"username has been removed from the .hubic_tokens file sent to the CE.")
156 if config.has_option(u"hubic", u"password"):
157 config.remove_option(u"hubic", u"password")
158 with open(TOKENS_FILE, u'wb') as configfile:
159 config.write(configfile)
160- print u"password has been removed from the .hubic_tokens file sent to the CE."
161+ print(u"password has been removed from the .hubic_tokens file sent to the CE.")
162
163 return oauth_token
164
165@@ -157,7 +158,7 @@
166 )
167 if r.status_code != 200:
168 if r.status_code == 509:
169- print u"status_code 509: attempt #", retries, u" failed"
170+ print(u"status_code 509: attempt #", retries, u" failed")
171 retries += 1
172 time.sleep(sleep_time)
173 sleep_time = sleep_time * 2
174
175=== modified file 'duplicity/backends/rsyncbackend.py'
176--- duplicity/backends/rsyncbackend.py 2018-07-23 14:55:39 +0000
177+++ duplicity/backends/rsyncbackend.py 2018-10-12 01:45:30 +0000
178@@ -1,3 +1,4 @@
179+from __future__ import print_function
180 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
181 #
182 # Copyright 2002 Ben Escoto <ben@emerose.org>
183@@ -143,7 +144,7 @@
184 path = os.path.join(dir, file)
185 to_delete.append(path)
186 f = open(path, u'w')
187- print >> exclude, file
188+ print(file, file=exclude)
189 f.close()
190 exclude.close()
191 commandline = (u"%s --recursive --delete --exclude-from=%s %s/ %s" %
192
193=== modified file 'duplicity/collections.py'
194--- duplicity/collections.py 2018-09-11 21:35:37 +0000
195+++ duplicity/collections.py 2018-10-12 01:45:30 +0000
196@@ -39,7 +39,7 @@
197
198 # For type testing against both int and long types that works in python 2/3
199 if sys.version_info < (3,):
200- integer_types = (int, types.LongType)
201+ integer_types = (int, int)
202 else:
203 integer_types = (int,)
204
205
206=== modified file 'duplicity/diffdir.py'
207--- duplicity/diffdir.py 2018-09-24 17:02:42 +0000
208+++ duplicity/diffdir.py 2018-10-12 01:45:30 +0000
209@@ -717,7 +717,7 @@
210 """
211 if isinstance(out_obj, Path):
212 fp = open(out_obj.name, u"wb")
213- elif isinstance(out_obj, types.StringTypes):
214+ elif isinstance(out_obj, (str, u"".__class__)):
215 fp = open(out_obj, u"wb")
216 else:
217 fp = out_obj
218
219=== modified file 'duplicity/dup_time.py'
220--- duplicity/dup_time.py 2018-09-11 21:35:37 +0000
221+++ duplicity/dup_time.py 2018-10-12 01:45:30 +0000
222@@ -260,10 +260,10 @@
223
224 def cmp(time1, time2):
225 u"""Compare time1 and time2 and return -1, 0, or 1"""
226- if isinstance(time1, types.StringTypes):
227+ if isinstance(time1, (str, u"".__class__)):
228 time1 = stringtotime(time1)
229 assert time1 is not None
230- if isinstance(time2, types.StringTypes):
231+ if isinstance(time2, (str, u"".__class__)):
232 time2 = stringtotime(time2)
233 assert time2 is not None
234
235
236=== modified file 'duplicity/gpg.py'
237--- duplicity/gpg.py 2018-09-11 21:35:37 +0000
238+++ duplicity/gpg.py 2018-10-12 01:45:30 +0000
239@@ -71,20 +71,20 @@
240 indicated, and recipients should be a list of keys. For all
241 keys, the format should be an hex key like 'AA0E73D2'.
242 """
243- assert passphrase is None or isinstance(passphrase, types.StringTypes)
244+ assert passphrase is None or isinstance(passphrase, (str, u"".__class__))
245
246 self.passphrase = passphrase
247 self.signing_passphrase = passphrase
248 self.sign_key = sign_key
249 self.encrypt_secring = None
250 if recipients is not None:
251- assert isinstance(recipients, types.ListType) # must be list, not tuple
252+ assert isinstance(recipients, list) # must be list, not tuple
253 self.recipients = recipients
254 else:
255 self.recipients = []
256
257 if hidden_recipients is not None:
258- assert isinstance(hidden_recipients, types.ListType) # must be list, not tuple
259+ assert isinstance(hidden_recipients, list) # must be list, not tuple
260 self.hidden_recipients = hidden_recipients
261 else:
262 self.hidden_recipients = []
263@@ -444,7 +444,7 @@
264 if bytes_to_go < block_iter.get_read_size():
265 break
266 try:
267- new_block = block_iter.next()
268+ new_block = next(block_iter)
269 except StopIteration:
270 at_end_of_blockiter = 1
271 break
272
273=== modified file 'duplicity/librsync.py'
274--- duplicity/librsync.py 2018-09-11 21:35:37 +0000
275+++ duplicity/librsync.py 2018-10-12 01:45:30 +0000
276@@ -149,7 +149,7 @@
277
278 """
279 LikeFile.__init__(self, new_file)
280- if isinstance(signature, types.StringType):
281+ if isinstance(signature, bytes):
282 sig_string = signature
283 else:
284 self.check_file(signature)
285
286=== modified file 'po/duplicity.pot'
287--- po/duplicity.pot 2018-10-11 20:10:01 +0000
288+++ po/duplicity.pot 2018-10-12 01:45:30 +0000
289@@ -8,7 +8,7 @@
290 msgstr ""
291 "Project-Id-Version: PACKAGE VERSION\n"
292 "Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"
293-"POT-Creation-Date: 2018-10-11 14:51-0500\n"
294+"POT-Creation-Date: 2018-10-11 20:32-0500\n"
295 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
296 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
297 "Language-Team: LANGUAGE <LL@li.org>\n"
298@@ -395,12 +395,12 @@
299 msgid "Backend error detail: %s"
300 msgstr ""
301
302-#: ../bin/rdiffdir:61 ../duplicity/commandline.py:263
303+#: ../bin/rdiffdir:62 ../duplicity/commandline.py:263
304 #, python-format
305 msgid "Error opening file %s"
306 msgstr ""
307
308-#: ../bin/rdiffdir:128
309+#: ../bin/rdiffdir:129
310 #, python-format
311 msgid "File %s already exists, will not overwrite."
312 msgstr ""
313
314=== modified file 'testing/functional/__init__.py'
315--- testing/functional/__init__.py 2018-07-24 20:57:03 +0000
316+++ testing/functional/__init__.py 2018-10-12 01:45:30 +0000
317@@ -1,3 +1,4 @@
318+from __future__ import print_function
319 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
320 #
321 # Copyright 2012 Canonical Ltd
322@@ -148,14 +149,14 @@
323 if fail:
324 self.assertEqual(30, return_val)
325 elif return_val:
326- print >>sys.stderr, u"\n...command:", cmdline
327- print >>sys.stderr, u"...cwd:", os.getcwd()
328- print >>sys.stderr, u"...output:"
329+ print(u"\n...command:", cmdline, file=sys.stderr)
330+ print(u"...cwd:", os.getcwd(), file=sys.stderr)
331+ print(u"...output:", file=sys.stderr)
332 for line in lines:
333 line = line.rstrip()
334 if line:
335- print >>sys.stderr, line
336- print >>sys.stderr, u"...return_val:", return_val
337+ print(line, file=sys.stderr)
338+ print(u"...return_val:", return_val, file=sys.stderr)
339 raise CmdError(return_val)
340
341 def backup(self, type, input_dir, options=[], **kwargs):
342
343=== modified file 'testing/unit/test_dup_time.py'
344--- testing/unit/test_dup_time.py 2018-07-27 02:18:12 +0000
345+++ testing/unit/test_dup_time.py 2018-10-12 01:45:30 +0000
346@@ -28,7 +28,7 @@
347
348 # For type testing against both int and long types that works in python 2/3
349 if sys.version_info < (3,):
350- integer_types = (int, types.LongType)
351+ integer_types = (int, int)
352 else:
353 integer_types = (int,)
354
355@@ -38,7 +38,7 @@
356 u"""test timetostring and stringtotime"""
357 dup_time.setcurtime()
358 assert type(dup_time.curtime) in integer_types
359- assert isinstance(dup_time.curtimestr, types.StringTypes)
360+ assert isinstance(dup_time.curtimestr, (str, u"".__class__))
361 assert (dup_time.cmp(int(dup_time.curtime), dup_time.curtimestr) == 0 or
362 dup_time.cmp(int(dup_time.curtime) + 1, dup_time.curtimestr) == 0)
363 time.sleep(1.05)
364
365=== modified file 'testing/unit/test_manifest.py'
366--- testing/unit/test_manifest.py 2018-07-27 02:18:12 +0000
367+++ testing/unit/test_manifest.py 2018-10-12 01:45:30 +0000
368@@ -40,7 +40,7 @@
369 vi.set_info(3, (u"hello", u"there"), None, (), None)
370 vi.set_hash(u"MD5", u"aoseutaohe")
371 s = vi.to_string()
372- assert isinstance(s, types.StringTypes)
373+ assert isinstance(s, (str, u"".__class__))
374 # print "---------\n%s\n---------" % s
375 vi2 = manifest.VolumeInfo()
376 vi2.from_string(s)
377@@ -55,7 +55,7 @@
378 (r"\n",),
379 None)
380 s = vi.to_string()
381- assert isinstance(s, types.StringTypes)
382+ assert isinstance(s, (str, u"".__class__))
383 # print "---------\n%s\n---------" % s
384 vi2 = manifest.VolumeInfo()
385 vi2.from_string(s)

Subscribers

People subscribed via source and target branches