]> Savannah Git Hosting - gnulib.git/commitdiff
vfs: remove backup indirection layer
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 20 Oct 2017 17:42:25 +0000 (20:42 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Fri, 20 Oct 2017 19:46:49 +0000 (22:46 +0300)
pygnulib/vfs.py

index b6b659da8389a1f719703033a02c6c8e13509706..2306e493ab1b5758d7f0839520c236e12ed8d358 100644 (file)
@@ -97,7 +97,8 @@ class Project(Base):
         self.__patch = path
 
 
-    def __backup(self, name):
+    def backup(self, name):
+        """Backup the given file."""
         backup = "{}~".format(name)
         try:
             _os_.unlink(self[backup])
@@ -106,11 +107,6 @@ class Project(Base):
         _shutil_.copy(self[name], self[backup])
 
 
-    def backup(self, name):
-        """Backup the given file."""
-        return self.__backup(name)
-
-
     def lookup(self, name, primary, secondary):
         """
         Try to look up a regular file inside virtual file systems or combine it via patch utility.
@@ -158,7 +154,7 @@ class Project(Base):
     def unlink(self, name, backup=True):
         """Unlink a file, backing it up if necessary."""
         if backup:
-            self.__backup(name)
+            self.backup(name)
         _os_.unlink(self[name])