duplicity-team team mailing list archive
-
duplicity-team team
-
Mailing list archive
-
Message #04849
[Merge] lp:~mgorse/duplicity/0.8-series into lp:duplicity
Mgorse has proposed merging lp:~mgorse/duplicity/0.8-series into lp:duplicity.
Requested reviews:
duplicity-team (duplicity-team)
For more details, see:
https://code.launchpad.net/~mgorse/duplicity/0.8-series/+merge/356627
--
Your team duplicity-team is requested to review the proposed merge of lp:~mgorse/duplicity/0.8-series into lp:duplicity.
=== modified file 'duplicity/backend.py'
--- duplicity/backend.py 2018-09-11 21:35:37 +0000
+++ duplicity/backend.py 2018-10-11 21:57:40 +0000
@@ -477,7 +477,7 @@
"""
import shlex
- if isinstance(commandline, (types.ListType, types.TupleType)):
+ if isinstance(commandline, (list, tuple)):
logstr = u' '.join(commandline)
args = commandline
else:
@@ -583,7 +583,7 @@
u"""
Delete each filename in filename_list, in order if possible.
"""
- assert not isinstance(filename_list, types.StringType)
+ assert not isinstance(filename_list, bytes)
if hasattr(self.backend, u'_delete_list'):
self._do_delete_list(filename_list)
elif hasattr(self.backend, u'_delete'):
=== modified file 'duplicity/backends/adbackend.py'
--- duplicity/backends/adbackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/adbackend.py 2018-10-11 21:57:40 +0000
@@ -1,3 +1,4 @@
+from __future__ import print_function
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2016 Stefan Breunig <stefan-duplicity@xxxxxxxxxxx>
=== modified file 'duplicity/backends/dpbxbackend.py'
--- duplicity/backends/dpbxbackend.py 2018-10-04 14:46:47 +0000
+++ duplicity/backends/dpbxbackend.py 2018-10-11 21:57:40 +0000
@@ -1,3 +1,4 @@
+from __future__ import print_function
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2013 jno <jno@xxxxxxxxx>
@@ -148,12 +149,12 @@
auth_flow = DropboxOAuth2FlowNoRedirect(app_key, app_secret)
log.Debug(u'dpbx,auth_flow.start()')
authorize_url = auth_flow.start()
- print
- print u'-' * 72
- print u"1. Go to: " + authorize_url
- print u"2. Click \"Allow\" (you might have to log in first)."
- print u"3. Copy the authorization code."
- print u'-' * 72
+ print()
+ print(u'-' * 72)
+ print(u"1. Go to: " + authorize_url)
+ print(u"2. Click \"Allow\" (you might have to log in first).")
+ print(u"3. Copy the authorization code.")
+ print(u'-' * 72)
auth_code = raw_input(u"Enter the authorization code here: ").strip()
try:
log.Debug(u'dpbx,auth_flow.finish(%s)' % auth_code)
=== modified file 'duplicity/backends/gdocsbackend.py'
--- duplicity/backends/gdocsbackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/gdocsbackend.py 2018-10-11 21:57:40 +0000
@@ -1,3 +1,4 @@
+from __future__ import print_function
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2011 Carlos Abalde <carlos.abalde@xxxxxxxxx>
=== modified file 'duplicity/backends/megabackend.py'
--- duplicity/backends/megabackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/megabackend.py 2018-10-11 21:57:40 +0000
@@ -1,3 +1,4 @@
+from __future__ import print_function
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2017 Tomas Vondra (Launchpad id: tomas-v)
=== modified file 'duplicity/backends/onedrivebackend.py'
--- duplicity/backends/onedrivebackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/onedrivebackend.py 2018-10-11 21:57:40 +0000
@@ -1,3 +1,4 @@
+from __future__ import print_function
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
# vim:tabstop=4:shiftwidth=4:expandtab
#
=== 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-11 21:57:40 +0000
@@ -3,6 +3,7 @@
# Copyright (c) 2014 Gu1
# Licensed under the MIT license
+from __future__ import print_function
import ConfigParser
import os
import re
@@ -122,12 +123,12 @@
config.remove_option(u"hubic", u"email")
with open(TOKENS_FILE, u'wb') as configfile:
config.write(configfile)
- print u"username has been removed from the .hubic_tokens file sent to the CE."
+ print(u"username has been removed from the .hubic_tokens file sent to the CE.")
if config.has_option(u"hubic", u"password"):
config.remove_option(u"hubic", u"password")
with open(TOKENS_FILE, u'wb') as configfile:
config.write(configfile)
- print u"password has been removed from the .hubic_tokens file sent to the CE."
+ print(u"password has been removed from the .hubic_tokens file sent to the CE.")
return oauth_token
@@ -157,7 +158,7 @@
)
if r.status_code != 200:
if r.status_code == 509:
- print u"status_code 509: attempt #", retries, u" failed"
+ print(u"status_code 509: attempt #", retries, u" failed")
retries += 1
time.sleep(sleep_time)
sleep_time = sleep_time * 2
=== modified file 'duplicity/backends/rsyncbackend.py'
--- duplicity/backends/rsyncbackend.py 2018-07-23 14:55:39 +0000
+++ duplicity/backends/rsyncbackend.py 2018-10-11 21:57:40 +0000
@@ -1,3 +1,4 @@
+from __future__ import print_function
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@xxxxxxxxxxx>
@@ -143,7 +144,7 @@
path = os.path.join(dir, file)
to_delete.append(path)
f = open(path, u'w')
- print >> exclude, file
+ print(file, file=exclude)
f.close()
exclude.close()
commandline = (u"%s --recursive --delete --exclude-from=%s %s/ %s" %
=== modified file 'duplicity/collections.py'
--- duplicity/collections.py 2018-09-11 21:35:37 +0000
+++ duplicity/collections.py 2018-10-11 21:57:40 +0000
@@ -39,7 +39,7 @@
# For type testing against both int and long types that works in python 2/3
if sys.version_info < (3,):
- integer_types = (int, types.LongType)
+ integer_types = (int, int)
else:
integer_types = (int,)
=== modified file 'duplicity/diffdir.py'
--- duplicity/diffdir.py 2018-09-24 17:02:42 +0000
+++ duplicity/diffdir.py 2018-10-11 21:57:40 +0000
@@ -717,7 +717,7 @@
"""
if isinstance(out_obj, Path):
fp = open(out_obj.name, u"wb")
- elif isinstance(out_obj, types.StringTypes):
+ elif isinstance(out_obj, (str, u"".__class__)):
fp = open(out_obj, u"wb")
else:
fp = out_obj
=== modified file 'duplicity/dup_time.py'
--- duplicity/dup_time.py 2018-09-11 21:35:37 +0000
+++ duplicity/dup_time.py 2018-10-11 21:57:40 +0000
@@ -260,10 +260,10 @@
def cmp(time1, time2):
u"""Compare time1 and time2 and return -1, 0, or 1"""
- if isinstance(time1, types.StringTypes):
+ if isinstance(time1, (str, u"".__class__)):
time1 = stringtotime(time1)
assert time1 is not None
- if isinstance(time2, types.StringTypes):
+ if isinstance(time2, (str, u"".__class__)):
time2 = stringtotime(time2)
assert time2 is not None
=== modified file 'duplicity/gpg.py'
--- duplicity/gpg.py 2018-09-11 21:35:37 +0000
+++ duplicity/gpg.py 2018-10-11 21:57:40 +0000
@@ -71,20 +71,20 @@
indicated, and recipients should be a list of keys. For all
keys, the format should be an hex key like 'AA0E73D2'.
"""
- assert passphrase is None or isinstance(passphrase, types.StringTypes)
+ assert passphrase is None or isinstance(passphrase, (str, u"".__class__))
self.passphrase = passphrase
self.signing_passphrase = passphrase
self.sign_key = sign_key
self.encrypt_secring = None
if recipients is not None:
- assert isinstance(recipients, types.ListType) # must be list, not tuple
+ assert isinstance(recipients, list) # must be list, not tuple
self.recipients = recipients
else:
self.recipients = []
if hidden_recipients is not None:
- assert isinstance(hidden_recipients, types.ListType) # must be list, not tuple
+ assert isinstance(hidden_recipients, list) # must be list, not tuple
self.hidden_recipients = hidden_recipients
else:
self.hidden_recipients = []
@@ -444,7 +444,7 @@
if bytes_to_go < block_iter.get_read_size():
break
try:
- new_block = block_iter.next()
+ new_block = next(block_iter)
except StopIteration:
at_end_of_blockiter = 1
break
=== modified file 'duplicity/librsync.py'
--- duplicity/librsync.py 2018-09-11 21:35:37 +0000
+++ duplicity/librsync.py 2018-10-11 21:57:40 +0000
@@ -149,7 +149,7 @@
"""
LikeFile.__init__(self, new_file)
- if isinstance(signature, types.StringType):
+ if isinstance(signature, bytes):
sig_string = signature
else:
self.check_file(signature)
=== modified file 'testing/functional/__init__.py'
--- testing/functional/__init__.py 2018-07-24 20:57:03 +0000
+++ testing/functional/__init__.py 2018-10-11 21:57:40 +0000
@@ -1,3 +1,4 @@
+from __future__ import print_function
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2012 Canonical Ltd
@@ -148,14 +149,14 @@
if fail:
self.assertEqual(30, return_val)
elif return_val:
- print >>sys.stderr, u"\n...command:", cmdline
- print >>sys.stderr, u"...cwd:", os.getcwd()
- print >>sys.stderr, u"...output:"
+ print(u"\n...command:", cmdline, file=sys.stderr)
+ print(u"...cwd:", os.getcwd(), file=sys.stderr)
+ print(u"...output:", file=sys.stderr)
for line in lines:
line = line.rstrip()
if line:
- print >>sys.stderr, line
- print >>sys.stderr, u"...return_val:", return_val
+ print(line, file=sys.stderr)
+ print(u"...return_val:", return_val, file=sys.stderr)
raise CmdError(return_val)
def backup(self, type, input_dir, options=[], **kwargs):
=== 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-11 21:57:40 +0000
@@ -28,7 +28,7 @@
# For type testing against both int and long types that works in python 2/3
if sys.version_info < (3,):
- integer_types = (int, types.LongType)
+ integer_types = (int, int)
else:
integer_types = (int,)
@@ -38,7 +38,7 @@
u"""test timetostring and stringtotime"""
dup_time.setcurtime()
assert type(dup_time.curtime) in integer_types
- assert isinstance(dup_time.curtimestr, types.StringTypes)
+ assert isinstance(dup_time.curtimestr, (str, u"".__class__))
assert (dup_time.cmp(int(dup_time.curtime), dup_time.curtimestr) == 0 or
dup_time.cmp(int(dup_time.curtime) + 1, dup_time.curtimestr) == 0)
time.sleep(1.05)
=== 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-11 21:57:40 +0000
@@ -40,7 +40,7 @@
vi.set_info(3, (u"hello", u"there"), None, (), None)
vi.set_hash(u"MD5", u"aoseutaohe")
s = vi.to_string()
- assert isinstance(s, types.StringTypes)
+ assert isinstance(s, (str, u"".__class__))
# print "---------\n%s\n---------" % s
vi2 = manifest.VolumeInfo()
vi2.from_string(s)
@@ -55,7 +55,7 @@
(r"\n",),
None)
s = vi.to_string()
- assert isinstance(s, types.StringTypes)
+ assert isinstance(s, (str, u"".__class__))
# print "---------\n%s\n---------" % s
vi2 = manifest.VolumeInfo()
vi2.from_string(s)
Follow ups