← Back to team overview

duplicity-team team mailing list archive

[Merge] lp:~aaron-whitehouse/duplicity/08-ufn-to-uc_name into lp:duplicity

 

Aaron Whitehouse has proposed merging lp:~aaron-whitehouse/duplicity/08-ufn-to-uc_name into lp:duplicity.

Requested reviews:
  duplicity-team (duplicity-team)

For more details, see:
https://code.launchpad.net/~aaron-whitehouse/duplicity/08-ufn-to-uc_name/+merge/335191

Replace util.ufn(path.name) with path.uc_name throughout.
-- 
Your team duplicity-team is requested to review the proposed merge of lp:~aaron-whitehouse/duplicity/08-ufn-to-uc_name into lp:duplicity.
=== 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 @@
             local_path.setdata()
             if not local_path.exists():
                 raise BackendException(_("File %s not found locally after get "
-                                         "from backend") % util.ufn(local_path.name))
+                                         "from backend") % local_path.uc_name)
         else:
             raise NotImplementedError()
 

=== 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 @@
              u"-----------------",
              _("Connecting with backend: %s") %
              (self.backend.__class__.__name__,),
-             _("Archive dir: %s") % (util.ufn(self.archive_dir_path.name if self.archive_dir_path else 'None'),)]
+             _("Archive dir: %s") % (self.archive_dir_path.uc_name if self.archive_dir_path else 'None',)]
 
         l.append("\n" +
                  ngettext("Found %d secondary backup chain.",

=== 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 @@
     set_archive_dir(expand_archive_dir(globals.archive_dir,
                                        globals.backup_name))
 
-    log.Info(_("Using archive dir: %s") % (util.ufn(globals.archive_dir_path.name),))
+    log.Info(_("Using archive dir: %s") % (globals.archive_dir_path.uc_name,))
     log.Info(_("Using backup name: %s") % (globals.backup_name,))
 
     return args
@@ -990,7 +990,7 @@
     archive_dir_path = path.Path(dirstring)
     if not archive_dir_path.isdir():
         log.FatalError(_("Specified archive directory '%s' does not exist, "
-                         "or is not a directory") % (util.ufn(archive_dir_path.name),),
+                         "or is not a directory") % (archive_dir_path.uc_name,),
                        log.ErrorCode.bad_archive_dir)
     globals.archive_dir_path = archive_dir_path
 
@@ -1059,18 +1059,18 @@
     if action == "restore":
         if (local_path.exists() and not local_path.isemptydir()) and not globals.force:
             log.FatalError(_("Restore destination directory %s already "
-                             "exists.\nWill not overwrite.") % (util.ufn(local_path.name),),
+                             "exists.\nWill not overwrite.") % (local_path.uc_name,),
                            log.ErrorCode.restore_dir_exists)
     elif action == "verify":
         if not local_path.exists():
             log.FatalError(_("Verify directory %s does not exist") %
-                           (util.ufn(local_path.name),),
+                           (local_path.uc_name,),
                            log.ErrorCode.verify_dir_doesnt_exist)
     else:
         assert action == "full" or action == "inc"
         if not local_path.exists():
             log.FatalError(_("Backup source directory %s does not exist.")
-                           % (util.ufn(local_path.name),),
+                           % (local_path.uc_name,),
                            log.ErrorCode.backup_dir_doesnt_exist)
 
     globals.local_path = local_path

=== 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 @@
             buf = self.infile.read(length)
         except IOError as ex:
             buf = ""
-            log.Warn(_("Error %s getting delta for %s") % (str(ex), util.ufn(self.infile.name)))
+            log.Warn(_("Error %s getting delta for %s") % (str(ex), self.infile.uc_name))
         if stats:
             stats.SourceFileSize += len(buf)
         return buf

=== 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 @@
             res = Block(self.fp.read(self.get_read_size()))
         except Exception:
             log.FatalError(_("Failed to read %s: %s") %
-                           (util.ufn(self.src.name), sys.exc_info()),
+                           (self.src.uc_name, sys.exc_info()),
                            log.ErrorCode.generic)
         if not res.data:
             self.fp.close()

=== 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 @@
         self.stat.st_mtime = int(tarinfo.mtime)
         if self.stat.st_mtime < 0:
             log.Warn(_("Warning: %s has negative mtime, treating as 0.")
-                     % (util.ufn(tarinfo.name)))
+                     % (tarinfo.uc_name))
             self.stat.st_mtime = 0
         self.stat.st_size = tarinfo.size
 
@@ -589,17 +589,17 @@
 
     def mkdir(self):
         """Make directory(s) at specified path"""
-        log.Info(_("Making directory %s") % util.ufn(self.name))
+        log.Info(_("Making directory %s") % self.uc_name)
         try:
             os.makedirs(self.name)
         except OSError:
             if (not globals.force):
-                raise PathException("Error creating directory %s" % util.ufn(self.name), 7)
+                raise PathException("Error creating directory %s" % self.uc_name, 7)
         self.setdata()
 
     def delete(self):
         """Remove this file"""
-        log.Info(_("Deleting %s") % util.ufn(self.name))
+        log.Info(_("Deleting %s") % self.uc_name)
         if self.isdir():
             util.ignore_missing(os.rmdir, self.name)
         else:
@@ -608,14 +608,14 @@
 
     def touch(self):
         """Open the file, write 0 bytes, close"""
-        log.Info(_("Touching %s") % util.ufn(self.name))
+        log.Info(_("Touching %s") % self.uc_name)
         fp = self.open("wb")
         fp.close()
 
     def deltree(self):
         """Remove self by recursively deleting files under it"""
         from duplicity import selection  # todo: avoid circ. dep. issue
-        log.Info(_("Deleting tree %s") % util.ufn(self.name))
+        log.Info(_("Deleting tree %s") % self.uc_name)
         itr = IterTreeReducer(PathDeleter, [])
         for path in selection.Select(self).set_iter():
             itr(path.index, path)
@@ -685,7 +685,7 @@
                 return temp_path
             _tmp_path_counter += 1
             assert _tmp_path_counter < 10000, \
-                u"Warning too many temp files created for " + util.ufn(self.name)
+                u"Warning too many temp files created for " + self.uc_name
 
     def compare_recursive(self, other, verbose=None):
         """Compare self to other Path, descending down directories"""

=== 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 @@
 def listpath(path):
     """Like path.listdir() but return [] if error, and sort results"""
     def error_handler(exc):
-        log.Warn(_("Error listing directory %s") % util.ufn(path.name))
+        log.Warn(_("Error listing directory %s") % path.uc_name)
         return []
     dir_listing = check_common_error(error_handler, path.listdir)
     dir_listing.sort()

=== 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 @@
                         # Path is a file or folder that cannot be read, but
                         # should be included or scanned.
                         log.Warn(_("Error accessing possibly locked file %s") %
-                                 util.ufn(new_path.name),
+                                 new_path.uc_name,
                                  log.WarningCode.cannot_read,
                                  util.escape(new_path.name))
                         if diffdir.stats:


Follow ups