From 8d54d4fcd456b3d57c86d35a3dc2544d21c93ef4 Mon Sep 17 00:00:00 2001 From: Joel Andres Granados Date: Thu, 23 Oct 2008 18:54:11 +0200 Subject: Create a new argument (reverting) for the BackupPersistent constructor. It is necessary to differentiate between calling the BackupPersistent class for backup purposes or for reverting purposes. Also the grub revert function and the firstaidkitrevert file changed to address the new changes. --- pyfirstaidkit/utils/backup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pyfirstaidkit/utils/backup.py') diff --git a/pyfirstaidkit/utils/backup.py b/pyfirstaidkit/utils/backup.py index 244e223..be086fb 100644 --- a/pyfirstaidkit/utils/backup.py +++ b/pyfirstaidkit/utils/backup.py @@ -238,6 +238,16 @@ class FileBackupStore(BackupStoreInterface): return False class BackupPersistent(Backup): + def __init__(self, id, path, reverting = False): + self._id = id + self._path = path + self._metafile = "__meta.pickle" + self._data = {} # name -> (stored as, origin) + self._origin = {} # origin -> name + + if not reverting: + os.makedirs(self._path) + def cleanup(self): self.saveMeta() return False -- cgit