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
=== modified file 'bin/duplicity'
--- bin/duplicity 2018-09-06 11:14:11 +0000
+++ bin/duplicity 2018-10-12 01:45:30 +0000
@@ -222,7 +222,7 @@
222 """222 """
223 try:223 try:
224 # Just spin our wheels224 # Just spin our wheels
225 while tarblock_iter.next():225 while next(tarblock_iter):
226 pass226 pass
227 except StopIteration:227 except StopIteration:
228 pass228 pass
@@ -247,7 +247,7 @@
247 last_block = globals.restart.last_block247 last_block = globals.restart.last_block
248 try:248 try:
249 # Just spin our wheels249 # Just spin our wheels
250 iter_result = tarblock_iter.next()250 iter_result = next(tarblock_iter)
251 while iter_result:251 while iter_result:
252 if (tarblock_iter.previous_index == last_index):252 if (tarblock_iter.previous_index == last_index):
253 # If both the previous index and this index are done, exit now253 # If both the previous index and this index are done, exit now
@@ -266,7 +266,7 @@
266 # We went too far! Stuff the data back into place before restarting266 # We went too far! Stuff the data back into place before restarting
267 tarblock_iter.queue_index_data(iter_result)267 tarblock_iter.queue_index_data(iter_result)
268 break268 break
269 iter_result = tarblock_iter.next()269 iter_result = next(tarblock_iter)
270 except StopIteration:270 except StopIteration:
271 log.Warn(_(u"File %s missing in backup set.\n"271 log.Warn(_(u"File %s missing in backup set.\n"
272 u"Continuing restart on file %s.") %272 u"Continuing restart on file %s.") %
273273
=== modified file 'bin/rdiffdir'
--- bin/rdiffdir 2018-07-22 14:36:15 +0000
+++ bin/rdiffdir 2018-10-12 01:45:30 +0000
@@ -25,6 +25,7 @@
25# Please send mail to me or the mailing list if you find bugs or have25# Please send mail to me or the mailing list if you find bugs or have
26# any suggestions.26# any suggestions.
2727
28from __future__ import print_function
28import sys29import sys
29import getopt30import getopt
30import gzip31import gzip
@@ -97,7 +98,7 @@
97 elif opt == u"--null-separator":98 elif opt == u"--null-separator":
98 globals.null_separator = 199 globals.null_separator = 1
99 elif opt == u"-V":100 elif opt == u"-V":
100 print u"rdiffdir", str(globals.version)101 print(u"rdiffdir", str(globals.version))
101 sys.exit(0)102 sys.exit(0)
102 elif opt == u"-v" or opt == u"--verbosity":103 elif opt == u"-v" or opt == u"--verbosity":
103 log.setverbosity(int(arg))104 log.setverbosity(int(arg))
104105
=== modified file 'duplicity/backend.py'
--- duplicity/backend.py 2018-09-11 21:35:37 +0000
+++ duplicity/backend.py 2018-10-12 01:45:30 +0000
@@ -477,7 +477,7 @@
477 """477 """
478 import shlex478 import shlex
479479
480 if isinstance(commandline, (types.ListType, types.TupleType)):480 if isinstance(commandline, (list, tuple)):
481 logstr = u' '.join(commandline)481 logstr = u' '.join(commandline)
482 args = commandline482 args = commandline
483 else:483 else:
@@ -583,7 +583,7 @@
583 u"""583 u"""
584 Delete each filename in filename_list, in order if possible.584 Delete each filename in filename_list, in order if possible.
585 """585 """
586 assert not isinstance(filename_list, types.StringType)586 assert not isinstance(filename_list, bytes)
587 if hasattr(self.backend, u'_delete_list'):587 if hasattr(self.backend, u'_delete_list'):
588 self._do_delete_list(filename_list)588 self._do_delete_list(filename_list)
589 elif hasattr(self.backend, u'_delete'):589 elif hasattr(self.backend, u'_delete'):
590590
=== modified file 'duplicity/backends/adbackend.py'
--- duplicity/backends/adbackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/adbackend.py 2018-10-12 01:45:30 +0000
@@ -1,3 +1,4 @@
1from __future__ import print_function
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-2# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2#3#
3# Copyright 2016 Stefan Breunig <stefan-duplicity@breunig.xyz>4# Copyright 2016 Stefan Breunig <stefan-duplicity@breunig.xyz>
45
=== modified file 'duplicity/backends/dpbxbackend.py'
--- duplicity/backends/dpbxbackend.py 2018-10-04 14:46:47 +0000
+++ duplicity/backends/dpbxbackend.py 2018-10-12 01:45:30 +0000
@@ -1,3 +1,4 @@
1from __future__ import print_function
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-2# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2#3#
3# Copyright 2013 jno <jno@pisem.net>4# Copyright 2013 jno <jno@pisem.net>
@@ -148,12 +149,12 @@
148 auth_flow = DropboxOAuth2FlowNoRedirect(app_key, app_secret)149 auth_flow = DropboxOAuth2FlowNoRedirect(app_key, app_secret)
149 log.Debug(u'dpbx,auth_flow.start()')150 log.Debug(u'dpbx,auth_flow.start()')
150 authorize_url = auth_flow.start()151 authorize_url = auth_flow.start()
151 print152 print()
152 print u'-' * 72153 print(u'-' * 72)
153 print u"1. Go to: " + authorize_url154 print(u"1. Go to: " + authorize_url)
154 print u"2. Click \"Allow\" (you might have to log in first)."155 print(u"2. Click \"Allow\" (you might have to log in first).")
155 print u"3. Copy the authorization code."156 print(u"3. Copy the authorization code.")
156 print u'-' * 72157 print(u'-' * 72)
157 auth_code = raw_input(u"Enter the authorization code here: ").strip()158 auth_code = raw_input(u"Enter the authorization code here: ").strip()
158 try:159 try:
159 log.Debug(u'dpbx,auth_flow.finish(%s)' % auth_code)160 log.Debug(u'dpbx,auth_flow.finish(%s)' % auth_code)
160161
=== modified file 'duplicity/backends/gdocsbackend.py'
--- duplicity/backends/gdocsbackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/gdocsbackend.py 2018-10-12 01:45:30 +0000
@@ -1,3 +1,4 @@
1from __future__ import print_function
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-2# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2#3#
3# Copyright 2011 Carlos Abalde <carlos.abalde@gmail.com>4# Copyright 2011 Carlos Abalde <carlos.abalde@gmail.com>
45
=== modified file 'duplicity/backends/megabackend.py'
--- duplicity/backends/megabackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/megabackend.py 2018-10-12 01:45:30 +0000
@@ -1,3 +1,4 @@
1from __future__ import print_function
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-2# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2#3#
3# Copyright 2017 Tomas Vondra (Launchpad id: tomas-v)4# Copyright 2017 Tomas Vondra (Launchpad id: tomas-v)
45
=== modified file 'duplicity/backends/onedrivebackend.py'
--- duplicity/backends/onedrivebackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/onedrivebackend.py 2018-10-12 01:45:30 +0000
@@ -1,3 +1,4 @@
1from __future__ import print_function
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-2# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2# vim:tabstop=4:shiftwidth=4:expandtab3# vim:tabstop=4:shiftwidth=4:expandtab
3#4#
45
=== modified file 'duplicity/backends/pyrax_identity/hubic.py'
--- duplicity/backends/pyrax_identity/hubic.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/pyrax_identity/hubic.py 2018-10-12 01:45:30 +0000
@@ -3,6 +3,7 @@
3# Copyright (c) 2014 Gu13# Copyright (c) 2014 Gu1
4# Licensed under the MIT license4# Licensed under the MIT license
55
6from __future__ import print_function
6import ConfigParser7import ConfigParser
7import os8import os
8import re9import re
@@ -122,12 +123,12 @@
122 config.remove_option(u"hubic", u"email")123 config.remove_option(u"hubic", u"email")
123 with open(TOKENS_FILE, u'wb') as configfile:124 with open(TOKENS_FILE, u'wb') as configfile:
124 config.write(configfile)125 config.write(configfile)
125 print u"username has been removed from the .hubic_tokens file sent to the CE."126 print(u"username has been removed from the .hubic_tokens file sent to the CE.")
126 if config.has_option(u"hubic", u"password"):127 if config.has_option(u"hubic", u"password"):
127 config.remove_option(u"hubic", u"password")128 config.remove_option(u"hubic", u"password")
128 with open(TOKENS_FILE, u'wb') as configfile:129 with open(TOKENS_FILE, u'wb') as configfile:
129 config.write(configfile)130 config.write(configfile)
130 print u"password has been removed from the .hubic_tokens file sent to the CE."131 print(u"password has been removed from the .hubic_tokens file sent to the CE.")
131132
132 return oauth_token133 return oauth_token
133134
@@ -157,7 +158,7 @@
157 )158 )
158 if r.status_code != 200:159 if r.status_code != 200:
159 if r.status_code == 509:160 if r.status_code == 509:
160 print u"status_code 509: attempt #", retries, u" failed"161 print(u"status_code 509: attempt #", retries, u" failed")
161 retries += 1162 retries += 1
162 time.sleep(sleep_time)163 time.sleep(sleep_time)
163 sleep_time = sleep_time * 2164 sleep_time = sleep_time * 2
164165
=== modified file 'duplicity/backends/rsyncbackend.py'
--- duplicity/backends/rsyncbackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/rsyncbackend.py 2018-10-12 01:45:30 +0000
@@ -1,3 +1,4 @@
1from __future__ import print_function
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-2# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2#3#
3# Copyright 2002 Ben Escoto <ben@emerose.org>4# Copyright 2002 Ben Escoto <ben@emerose.org>
@@ -143,7 +144,7 @@
143 path = os.path.join(dir, file)144 path = os.path.join(dir, file)
144 to_delete.append(path)145 to_delete.append(path)
145 f = open(path, u'w')146 f = open(path, u'w')
146 print >> exclude, file147 print(file, file=exclude)
147 f.close()148 f.close()
148 exclude.close()149 exclude.close()
149 commandline = (u"%s --recursive --delete --exclude-from=%s %s/ %s" %150 commandline = (u"%s --recursive --delete --exclude-from=%s %s/ %s" %
150151
=== modified file 'duplicity/collections.py'
--- duplicity/collections.py 2018-09-11 21:35:37 +0000
+++ duplicity/collections.py 2018-10-12 01:45:30 +0000
@@ -39,7 +39,7 @@
3939
40# For type testing against both int and long types that works in python 2/340# For type testing against both int and long types that works in python 2/3
41if sys.version_info < (3,):41if sys.version_info < (3,):
42 integer_types = (int, types.LongType)42 integer_types = (int, int)
43else:43else:
44 integer_types = (int,)44 integer_types = (int,)
4545
4646
=== modified file 'duplicity/diffdir.py'
--- duplicity/diffdir.py 2018-09-24 17:02:42 +0000
+++ duplicity/diffdir.py 2018-10-12 01:45:30 +0000
@@ -717,7 +717,7 @@
717 """717 """
718 if isinstance(out_obj, Path):718 if isinstance(out_obj, Path):
719 fp = open(out_obj.name, u"wb")719 fp = open(out_obj.name, u"wb")
720 elif isinstance(out_obj, types.StringTypes):720 elif isinstance(out_obj, (str, u"".__class__)):
721 fp = open(out_obj, u"wb")721 fp = open(out_obj, u"wb")
722 else:722 else:
723 fp = out_obj723 fp = out_obj
724724
=== modified file 'duplicity/dup_time.py'
--- duplicity/dup_time.py 2018-09-11 21:35:37 +0000
+++ duplicity/dup_time.py 2018-10-12 01:45:30 +0000
@@ -260,10 +260,10 @@
260260
261def cmp(time1, time2):261def cmp(time1, time2):
262 u"""Compare time1 and time2 and return -1, 0, or 1"""262 u"""Compare time1 and time2 and return -1, 0, or 1"""
263 if isinstance(time1, types.StringTypes):263 if isinstance(time1, (str, u"".__class__)):
264 time1 = stringtotime(time1)264 time1 = stringtotime(time1)
265 assert time1 is not None265 assert time1 is not None
266 if isinstance(time2, types.StringTypes):266 if isinstance(time2, (str, u"".__class__)):
267 time2 = stringtotime(time2)267 time2 = stringtotime(time2)
268 assert time2 is not None268 assert time2 is not None
269269
270270
=== modified file 'duplicity/gpg.py'
--- duplicity/gpg.py 2018-09-11 21:35:37 +0000
+++ duplicity/gpg.py 2018-10-12 01:45:30 +0000
@@ -71,20 +71,20 @@
71 indicated, and recipients should be a list of keys. For all71 indicated, and recipients should be a list of keys. For all
72 keys, the format should be an hex key like 'AA0E73D2'.72 keys, the format should be an hex key like 'AA0E73D2'.
73 """73 """
74 assert passphrase is None or isinstance(passphrase, types.StringTypes)74 assert passphrase is None or isinstance(passphrase, (str, u"".__class__))
7575
76 self.passphrase = passphrase76 self.passphrase = passphrase
77 self.signing_passphrase = passphrase77 self.signing_passphrase = passphrase
78 self.sign_key = sign_key78 self.sign_key = sign_key
79 self.encrypt_secring = None79 self.encrypt_secring = None
80 if recipients is not None:80 if recipients is not None:
81 assert isinstance(recipients, types.ListType) # must be list, not tuple81 assert isinstance(recipients, list) # must be list, not tuple
82 self.recipients = recipients82 self.recipients = recipients
83 else:83 else:
84 self.recipients = []84 self.recipients = []
8585
86 if hidden_recipients is not None:86 if hidden_recipients is not None:
87 assert isinstance(hidden_recipients, types.ListType) # must be list, not tuple87 assert isinstance(hidden_recipients, list) # must be list, not tuple
88 self.hidden_recipients = hidden_recipients88 self.hidden_recipients = hidden_recipients
89 else:89 else:
90 self.hidden_recipients = []90 self.hidden_recipients = []
@@ -444,7 +444,7 @@
444 if bytes_to_go < block_iter.get_read_size():444 if bytes_to_go < block_iter.get_read_size():
445 break445 break
446 try:446 try:
447 new_block = block_iter.next()447 new_block = next(block_iter)
448 except StopIteration:448 except StopIteration:
449 at_end_of_blockiter = 1449 at_end_of_blockiter = 1
450 break450 break
451451
=== modified file 'duplicity/librsync.py'
--- duplicity/librsync.py 2018-09-11 21:35:37 +0000
+++ duplicity/librsync.py 2018-10-12 01:45:30 +0000
@@ -149,7 +149,7 @@
149149
150 """150 """
151 LikeFile.__init__(self, new_file)151 LikeFile.__init__(self, new_file)
152 if isinstance(signature, types.StringType):152 if isinstance(signature, bytes):
153 sig_string = signature153 sig_string = signature
154 else:154 else:
155 self.check_file(signature)155 self.check_file(signature)
156156
=== modified file 'po/duplicity.pot'
--- po/duplicity.pot 2018-10-11 20:10:01 +0000
+++ po/duplicity.pot 2018-10-12 01:45:30 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"10"Report-Msgid-Bugs-To: Kenneth Loafman <kenneth@loafman.com>\n"
11"POT-Creation-Date: 2018-10-11 14:51-0500\n"11"POT-Creation-Date: 2018-10-11 20:32-0500\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -395,12 +395,12 @@
395msgid "Backend error detail: %s"395msgid "Backend error detail: %s"
396msgstr ""396msgstr ""
397397
398#: ../bin/rdiffdir:61 ../duplicity/commandline.py:263398#: ../bin/rdiffdir:62 ../duplicity/commandline.py:263
399#, python-format399#, python-format
400msgid "Error opening file %s"400msgid "Error opening file %s"
401msgstr ""401msgstr ""
402402
403#: ../bin/rdiffdir:128403#: ../bin/rdiffdir:129
404#, python-format404#, python-format
405msgid "File %s already exists, will not overwrite."405msgid "File %s already exists, will not overwrite."
406msgstr ""406msgstr ""
407407
=== modified file 'testing/functional/__init__.py'
--- testing/functional/__init__.py 2018-07-24 20:57:03 +0000
+++ testing/functional/__init__.py 2018-10-12 01:45:30 +0000
@@ -1,3 +1,4 @@
1from __future__ import print_function
1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-2# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
2#3#
3# Copyright 2012 Canonical Ltd4# Copyright 2012 Canonical Ltd
@@ -148,14 +149,14 @@
148 if fail:149 if fail:
149 self.assertEqual(30, return_val)150 self.assertEqual(30, return_val)
150 elif return_val:151 elif return_val:
151 print >>sys.stderr, u"\n...command:", cmdline152 print(u"\n...command:", cmdline, file=sys.stderr)
152 print >>sys.stderr, u"...cwd:", os.getcwd()153 print(u"...cwd:", os.getcwd(), file=sys.stderr)
153 print >>sys.stderr, u"...output:"154 print(u"...output:", file=sys.stderr)
154 for line in lines:155 for line in lines:
155 line = line.rstrip()156 line = line.rstrip()
156 if line:157 if line:
157 print >>sys.stderr, line158 print(line, file=sys.stderr)
158 print >>sys.stderr, u"...return_val:", return_val159 print(u"...return_val:", return_val, file=sys.stderr)
159 raise CmdError(return_val)160 raise CmdError(return_val)
160161
161 def backup(self, type, input_dir, options=[], **kwargs):162 def backup(self, type, input_dir, options=[], **kwargs):
162163
=== modified file 'testing/unit/test_dup_time.py'
--- testing/unit/test_dup_time.py 2018-07-27 02:18:12 +0000
+++ testing/unit/test_dup_time.py 2018-10-12 01:45:30 +0000
@@ -28,7 +28,7 @@
2828
29# For type testing against both int and long types that works in python 2/329# For type testing against both int and long types that works in python 2/3
30if sys.version_info < (3,):30if sys.version_info < (3,):
31 integer_types = (int, types.LongType)31 integer_types = (int, int)
32else:32else:
33 integer_types = (int,)33 integer_types = (int,)
3434
@@ -38,7 +38,7 @@
38 u"""test timetostring and stringtotime"""38 u"""test timetostring and stringtotime"""
39 dup_time.setcurtime()39 dup_time.setcurtime()
40 assert type(dup_time.curtime) in integer_types40 assert type(dup_time.curtime) in integer_types
41 assert isinstance(dup_time.curtimestr, types.StringTypes)41 assert isinstance(dup_time.curtimestr, (str, u"".__class__))
42 assert (dup_time.cmp(int(dup_time.curtime), dup_time.curtimestr) == 0 or42 assert (dup_time.cmp(int(dup_time.curtime), dup_time.curtimestr) == 0 or
43 dup_time.cmp(int(dup_time.curtime) + 1, dup_time.curtimestr) == 0)43 dup_time.cmp(int(dup_time.curtime) + 1, dup_time.curtimestr) == 0)
44 time.sleep(1.05)44 time.sleep(1.05)
4545
=== modified file 'testing/unit/test_manifest.py'
--- testing/unit/test_manifest.py 2018-07-27 02:18:12 +0000
+++ testing/unit/test_manifest.py 2018-10-12 01:45:30 +0000
@@ -40,7 +40,7 @@
40 vi.set_info(3, (u"hello", u"there"), None, (), None)40 vi.set_info(3, (u"hello", u"there"), None, (), None)
41 vi.set_hash(u"MD5", u"aoseutaohe")41 vi.set_hash(u"MD5", u"aoseutaohe")
42 s = vi.to_string()42 s = vi.to_string()
43 assert isinstance(s, types.StringTypes)43 assert isinstance(s, (str, u"".__class__))
44 # print "---------\n%s\n---------" % s44 # print "---------\n%s\n---------" % s
45 vi2 = manifest.VolumeInfo()45 vi2 = manifest.VolumeInfo()
46 vi2.from_string(s)46 vi2.from_string(s)
@@ -55,7 +55,7 @@
55 (r"\n",),55 (r"\n",),
56 None)56 None)
57 s = vi.to_string()57 s = vi.to_string()
58 assert isinstance(s, types.StringTypes)58 assert isinstance(s, (str, u"".__class__))
59 # print "---------\n%s\n---------" % s59 # print "---------\n%s\n---------" % s
60 vi2 = manifest.VolumeInfo()60 vi2 = manifest.VolumeInfo()
61 vi2.from_string(s)61 vi2.from_string(s)

Subscribers

People subscribed via source and target branches