From: Dmitry Selyutin Date: Fri, 20 Oct 2017 17:42:25 +0000 (+0300) Subject: vfs: remove backup indirection layer X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=5def4d9860cf230b376a18d9a3f2de33284c459b;p=gnulib.git vfs: remove backup indirection layer --- diff --git a/pygnulib/vfs.py b/pygnulib/vfs.py index b6b659da83..2306e493ab 100644 --- a/pygnulib/vfs.py +++ b/pygnulib/vfs.py @@ -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])