BackupRestoreAPI

from ubuntutweak.modules import TweakModule
from ubuntutweak.backup import BackupManager

class SourceEditor(TweakModule, BackupManager):
    def __init__(self):
        pass

    def backup_sourcelist(self):
        '''
        method from BackupManager
        the default result will be /etc/apt/sources.list.ut-20110523
        '''
        return self.backup_file('/etc/apt/sources.list')

    def get_latest_backup(self):
        '''
        A list sorted by date based name, or []
        '''
        return self.get_backups('/etc/apt/sources.list')[0]

    def restore_with_backup(self, name):
        pass

from ubuntutweak.modules import TweakModule
from ubuntutweak.backup import BackupManager

class DesktopRecovery(TweakModule, BackupManager):
    def __init__(self):
        pass

    def backup_gconf(self):
        '''
        method from BackupManager
        the default result will be /etc/apt/sources.list.ut-20110523
        '''
        return self.backup_file('/etc/apt/sources.list')

    def get_latest_backup(self):
        '''
        A list sorted by date based name, or []
        '''
        return self.get_backups('/etc/apt/sources.list')[0]

    def restore_with_backup(self, name):
        pass

    def reset_to_default(self):
        '''
        if there's default value, so reset
        '''
        self.reset()

UbuntuTweak/BackupRestoreAPI (last edited 2011-05-23 14:05:07 by tualatrix)