changeset 39048:13693b2945b4

vfs: remove backup indirection layer
author Dmitry Selyutin <ghostmansd@gmail.com>
date Fri, 20 Oct 2017 20:42:25 +0300
parents 8bd0b74f5c0f
children afbec01ffab6
files pygnulib/vfs.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/pygnulib/vfs.py	Fri Oct 20 20:41:21 2017 +0300
+++ b/pygnulib/vfs.py	Fri Oct 20 20:42:25 2017 +0300
@@ -97,7 +97,8 @@
         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 @@
         _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 @@
     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])