# Path: snap/snapshottarget.py
# class SnapshotTarget:
#     """Abstract entity on which to perform and restore a snapshot"""
# 
#     # actual target backends snap implements (in the order which they are to execute)
#     BACKENDS = ['repos', 'packages', 'files', 'services']
# 
#     def backup(self, basedir):
#          '''Take a snapshot of the target
# 
#             @param - basedir - directory which to store snapshot data in'''
#          raise NotImplementedError()
# 
#     def restore(self, basedir):
#         '''Restore any package management files previously backed up
#            
#            @param - basedir - directory which to restore snapshot from'''
#         raise NotImplementedError()
# 
# Path: snap/exceptions.py
# class ArgError(SnapError):
#     """An illegal arguement to the system was specified or an invalid 
#        option set was detected in ConfigManager.verify_integrity()"""
# 
#     def __init__(self,message = ''):
#         SnapError.__init__(self, message)


import os
import os.path
import optparse, ConfigParser
import snap
from snap.options import *
from snap.snapshottarget import SnapshotTarget
from snap.exceptions import ArgError
        '''initialize configuration'''

        # mode of operation
        self.mode = None

        # mapping of targets to lists of backends to use when backing up / restoring them
        self.target_backends = {}

        # mapping of targets to lists of entities to include when backing up
        self.target_includes = {}

        # mapping of targets to lists of entities to exclude when backing up
        self.target_excludes = {}

        # output log level
        # currently supports 'quiet', 'normal', 'verbose', 'debug'
        self.log_level = 'normal'

        # output format to backup / restore
        self.outputformat = 'snapfile'

        # location of the snapfile to backup to / restore from
        self.snapfile = None

        # Encryption/decryption password to use, if left as None, encryption will be disabled
        self.encryption_password = None
        
        # hash of key/value pairs of service-specific options
        self.service_options = {}


# Path: snap/snapshottarget.py
# class SnapshotTarget:
#     """Abstract entity on which to perform and restore a snapshot"""
# 
#     # actual target backends snap implements (in the order which they are to execute)
#     BACKENDS = ['repos', 'packages', 'files', 'services']
# 
#     def backup(self, basedir):
#          '''Take a snapshot of the target
# 
#             @param - basedir - directory which to store snapshot data in'''
#          raise NotImplementedError()
# 
#     def restore(self, basedir):
#         '''Restore any package management files previously backed up
#            
#            @param - basedir - directory which to restore snapshot from'''
#         raise NotImplementedError()
# 
# Path: snap/exceptions.py
# class ArgError(SnapError):
#     """An illegal arguement to the system was specified or an invalid 
#        option set was detected in ConfigManager.verify_integrity()"""
# 
#     def __init__(self,message = ''):
#         SnapError.__init__(self, message)


# Path: snap/config.py
import os
import os.path
import optparse, ConfigParser
import snap
from snap.options import *
from snap.snapshottarget import SnapshotTarget
from snap.exceptions import ArgError

        '''initialize configuration'''

        # mode of operation
        self.mode = None

        # mapping of targets to lists of backends to use when backing up / restoring them
        self.target_backends = {}

        # mapping of targets to lists of entities to include when backing up
        self.target_includes = {}

        # mapping of targets to lists of entities to exclude when backing up
        self.target_excludes = {}

        # output log level
        # currently supports 'quiet', 'normal', 'verbose', 'debug'
        self.log_level = 'normal'

        # output format to backup / restore
        self.outputformat = 'snapfile'

        # location of the snapfile to backup to / restore from
        self.snapfile = None

        # Encryption/decryption password to use, if left as None, encryption will be disabled
        self.encryption_password = None
        
        # hash of key/value pairs of service-specific options
        self.service_options = {}


        for backend in SnapshotTarget.BACKENDS: