self.__patch = path
- def __backup(self, name):
+ def backup(self, name):
+ """Backup the given file."""
backup = "{}~".format(name)
try:
_os_.unlink(self[backup])
_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.
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])