Merge lp:~aaron-whitehouse/duplicity/08-ufn-to-uc_name into lp:~duplicity-team/duplicity/0.8-series

Proposed by Aaron Whitehouse
Status: Merged
Merged at revision: 1293
Proposed branch: lp:~aaron-whitehouse/duplicity/08-ufn-to-uc_name
Merge into: lp:~duplicity-team/duplicity/0.8-series
Diff against target: 181 lines (+18/-18)
8 files modified
duplicity/backend.py (+1/-1)
duplicity/collections.py (+1/-1)
duplicity/commandline.py (+5/-5)
duplicity/diffdir.py (+1/-1)
duplicity/dup_temp.py (+1/-1)
duplicity/path.py (+7/-7)
duplicity/robust.py (+1/-1)
duplicity/selection.py (+1/-1)
To merge this branch: bzr merge lp:~aaron-whitehouse/duplicity/08-ufn-to-uc_name
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+335191@code.launchpad.net

Description of the change

Replace util.ufn(path.name) with path.uc_name throughout.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'duplicity/backend.py'
--- duplicity/backend.py 2017-11-27 22:26:22 +0000
+++ duplicity/backend.py 2017-12-13 22:56:51 +0000
@@ -553,7 +553,7 @@
553 local_path.setdata()553 local_path.setdata()
554 if not local_path.exists():554 if not local_path.exists():
555 raise BackendException(_("File %s not found locally after get "555 raise BackendException(_("File %s not found locally after get "
556 "from backend") % util.ufn(local_path.name))556 "from backend") % local_path.uc_name)
557 else:557 else:
558 raise NotImplementedError()558 raise NotImplementedError()
559559
560560
=== modified file 'duplicity/collections.py'
--- duplicity/collections.py 2017-11-18 17:06:48 +0000
+++ duplicity/collections.py 2017-12-13 22:56:51 +0000
@@ -649,7 +649,7 @@
649 u"-----------------",649 u"-----------------",
650 _("Connecting with backend: %s") %650 _("Connecting with backend: %s") %
651 (self.backend.__class__.__name__,),651 (self.backend.__class__.__name__,),
652 _("Archive dir: %s") % (util.ufn(self.archive_dir_path.name if self.archive_dir_path else 'None'),)]652 _("Archive dir: %s") % (self.archive_dir_path.uc_name if self.archive_dir_path else 'None',)]
653653
654 l.append("\n" +654 l.append("\n" +
655 ngettext("Found %d secondary backup chain.",655 ngettext("Found %d secondary backup chain.",
656656
=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py 2017-12-01 22:39:33 +0000
+++ duplicity/commandline.py 2017-12-13 22:56:51 +0000
@@ -763,7 +763,7 @@
763 set_archive_dir(expand_archive_dir(globals.archive_dir,763 set_archive_dir(expand_archive_dir(globals.archive_dir,
764 globals.backup_name))764 globals.backup_name))
765765
766 log.Info(_("Using archive dir: %s") % (util.ufn(globals.archive_dir_path.name),))766 log.Info(_("Using archive dir: %s") % (globals.archive_dir_path.uc_name,))
767 log.Info(_("Using backup name: %s") % (globals.backup_name,))767 log.Info(_("Using backup name: %s") % (globals.backup_name,))
768768
769 return args769 return args
@@ -990,7 +990,7 @@
990 archive_dir_path = path.Path(dirstring)990 archive_dir_path = path.Path(dirstring)
991 if not archive_dir_path.isdir():991 if not archive_dir_path.isdir():
992 log.FatalError(_("Specified archive directory '%s' does not exist, "992 log.FatalError(_("Specified archive directory '%s' does not exist, "
993 "or is not a directory") % (util.ufn(archive_dir_path.name),),993 "or is not a directory") % (archive_dir_path.uc_name,),
994 log.ErrorCode.bad_archive_dir)994 log.ErrorCode.bad_archive_dir)
995 globals.archive_dir_path = archive_dir_path995 globals.archive_dir_path = archive_dir_path
996996
@@ -1059,18 +1059,18 @@
1059 if action == "restore":1059 if action == "restore":
1060 if (local_path.exists() and not local_path.isemptydir()) and not globals.force:1060 if (local_path.exists() and not local_path.isemptydir()) and not globals.force:
1061 log.FatalError(_("Restore destination directory %s already "1061 log.FatalError(_("Restore destination directory %s already "
1062 "exists.\nWill not overwrite.") % (util.ufn(local_path.name),),1062 "exists.\nWill not overwrite.") % (local_path.uc_name,),
1063 log.ErrorCode.restore_dir_exists)1063 log.ErrorCode.restore_dir_exists)
1064 elif action == "verify":1064 elif action == "verify":
1065 if not local_path.exists():1065 if not local_path.exists():
1066 log.FatalError(_("Verify directory %s does not exist") %1066 log.FatalError(_("Verify directory %s does not exist") %
1067 (util.ufn(local_path.name),),1067 (local_path.uc_name,),
1068 log.ErrorCode.verify_dir_doesnt_exist)1068 log.ErrorCode.verify_dir_doesnt_exist)
1069 else:1069 else:
1070 assert action == "full" or action == "inc"1070 assert action == "full" or action == "inc"
1071 if not local_path.exists():1071 if not local_path.exists():
1072 log.FatalError(_("Backup source directory %s does not exist.")1072 log.FatalError(_("Backup source directory %s does not exist.")
1073 % (util.ufn(local_path.name),),1073 % (local_path.uc_name,),
1074 log.ErrorCode.backup_dir_doesnt_exist)1074 log.ErrorCode.backup_dir_doesnt_exist)
10751075
1076 globals.local_path = local_path1076 globals.local_path = local_path
10771077
=== modified file 'duplicity/diffdir.py'
--- duplicity/diffdir.py 2017-01-19 00:32:12 +0000
+++ duplicity/diffdir.py 2017-12-13 22:56:51 +0000
@@ -395,7 +395,7 @@
395 buf = self.infile.read(length)395 buf = self.infile.read(length)
396 except IOError as ex:396 except IOError as ex:
397 buf = ""397 buf = ""
398 log.Warn(_("Error %s getting delta for %s") % (str(ex), util.ufn(self.infile.name)))398 log.Warn(_("Error %s getting delta for %s") % (str(ex), self.infile.uc_name))
399 if stats:399 if stats:
400 stats.SourceFileSize += len(buf)400 stats.SourceFileSize += len(buf)
401 return buf401 return buf
402402
=== modified file 'duplicity/dup_temp.py'
--- duplicity/dup_temp.py 2017-07-11 14:55:38 +0000
+++ duplicity/dup_temp.py 2017-12-13 22:56:51 +0000
@@ -264,7 +264,7 @@
264 res = Block(self.fp.read(self.get_read_size()))264 res = Block(self.fp.read(self.get_read_size()))
265 except Exception:265 except Exception:
266 log.FatalError(_("Failed to read %s: %s") %266 log.FatalError(_("Failed to read %s: %s") %
267 (util.ufn(self.src.name), sys.exc_info()),267 (self.src.uc_name, sys.exc_info()),
268 log.ErrorCode.generic)268 log.ErrorCode.generic)
269 if not res.data:269 if not res.data:
270 self.fp.close()270 self.fp.close()
271271
=== modified file 'duplicity/path.py'
--- duplicity/path.py 2017-12-01 22:39:33 +0000
+++ duplicity/path.py 2017-12-13 22:56:51 +0000
@@ -236,7 +236,7 @@
236 self.stat.st_mtime = int(tarinfo.mtime)236 self.stat.st_mtime = int(tarinfo.mtime)
237 if self.stat.st_mtime < 0:237 if self.stat.st_mtime < 0:
238 log.Warn(_("Warning: %s has negative mtime, treating as 0.")238 log.Warn(_("Warning: %s has negative mtime, treating as 0.")
239 % (util.ufn(tarinfo.name)))239 % (tarinfo.uc_name))
240 self.stat.st_mtime = 0240 self.stat.st_mtime = 0
241 self.stat.st_size = tarinfo.size241 self.stat.st_size = tarinfo.size
242242
@@ -589,17 +589,17 @@
589589
590 def mkdir(self):590 def mkdir(self):
591 """Make directory(s) at specified path"""591 """Make directory(s) at specified path"""
592 log.Info(_("Making directory %s") % util.ufn(self.name))592 log.Info(_("Making directory %s") % self.uc_name)
593 try:593 try:
594 os.makedirs(self.name)594 os.makedirs(self.name)
595 except OSError:595 except OSError:
596 if (not globals.force):596 if (not globals.force):
597 raise PathException("Error creating directory %s" % util.ufn(self.name), 7)597 raise PathException("Error creating directory %s" % self.uc_name, 7)
598 self.setdata()598 self.setdata()
599599
600 def delete(self):600 def delete(self):
601 """Remove this file"""601 """Remove this file"""
602 log.Info(_("Deleting %s") % util.ufn(self.name))602 log.Info(_("Deleting %s") % self.uc_name)
603 if self.isdir():603 if self.isdir():
604 util.ignore_missing(os.rmdir, self.name)604 util.ignore_missing(os.rmdir, self.name)
605 else:605 else:
@@ -608,14 +608,14 @@
608608
609 def touch(self):609 def touch(self):
610 """Open the file, write 0 bytes, close"""610 """Open the file, write 0 bytes, close"""
611 log.Info(_("Touching %s") % util.ufn(self.name))611 log.Info(_("Touching %s") % self.uc_name)
612 fp = self.open("wb")612 fp = self.open("wb")
613 fp.close()613 fp.close()
614614
615 def deltree(self):615 def deltree(self):
616 """Remove self by recursively deleting files under it"""616 """Remove self by recursively deleting files under it"""
617 from duplicity import selection # todo: avoid circ. dep. issue617 from duplicity import selection # todo: avoid circ. dep. issue
618 log.Info(_("Deleting tree %s") % util.ufn(self.name))618 log.Info(_("Deleting tree %s") % self.uc_name)
619 itr = IterTreeReducer(PathDeleter, [])619 itr = IterTreeReducer(PathDeleter, [])
620 for path in selection.Select(self).set_iter():620 for path in selection.Select(self).set_iter():
621 itr(path.index, path)621 itr(path.index, path)
@@ -685,7 +685,7 @@
685 return temp_path685 return temp_path
686 _tmp_path_counter += 1686 _tmp_path_counter += 1
687 assert _tmp_path_counter < 10000, \687 assert _tmp_path_counter < 10000, \
688 u"Warning too many temp files created for " + util.ufn(self.name)688 u"Warning too many temp files created for " + self.uc_name
689689
690 def compare_recursive(self, other, verbose=None):690 def compare_recursive(self, other, verbose=None):
691 """Compare self to other Path, descending down directories"""691 """Compare self to other Path, descending down directories"""
692692
=== modified file 'duplicity/robust.py'
--- duplicity/robust.py 2017-03-02 22:38:47 +0000
+++ duplicity/robust.py 2017-12-13 22:56:51 +0000
@@ -61,7 +61,7 @@
61def listpath(path):61def listpath(path):
62 """Like path.listdir() but return [] if error, and sort results"""62 """Like path.listdir() but return [] if error, and sort results"""
63 def error_handler(exc):63 def error_handler(exc):
64 log.Warn(_("Error listing directory %s") % util.ufn(path.name))64 log.Warn(_("Error listing directory %s") % path.uc_name)
65 return []65 return []
66 dir_listing = check_common_error(error_handler, path.listdir)66 dir_listing = check_common_error(error_handler, path.listdir)
67 dir_listing.sort()67 dir_listing.sort()
6868
=== modified file 'duplicity/selection.py'
--- duplicity/selection.py 2017-12-01 22:39:33 +0000
+++ duplicity/selection.py 2017-12-13 22:56:51 +0000
@@ -150,7 +150,7 @@
150 # Path is a file or folder that cannot be read, but150 # Path is a file or folder that cannot be read, but
151 # should be included or scanned.151 # should be included or scanned.
152 log.Warn(_("Error accessing possibly locked file %s") %152 log.Warn(_("Error accessing possibly locked file %s") %
153 util.ufn(new_path.name),153 new_path.uc_name,
154 log.WarningCode.cannot_read,154 log.WarningCode.cannot_read,
155 util.escape(new_path.name))155 util.escape(new_path.name))
156 if diffdir.stats:156 if diffdir.stats:

Subscribers

People subscribed via source and target branches