# Path: duplicity/globals.py

# 
# Path: duplicity/gpg.py
# class GPGError(Exception):
#     """
#     Indicate some GPG Error
#     """
#     pass


import types
import gettext
from duplicity import log
from duplicity import file_naming
from duplicity import path
from duplicity import dup_time
from duplicity import globals
from duplicity import manifest
from duplicity.gpg import GPGError
                log.FatalError(_("Fatal Error: Remote manifest does not match "
                                 "local one.  Either the remote backup set or "
                                 "the local archive directory has been corrupted."),
                               log.ErrorCode.mismatched_manifests)
        if not remote_manifest:
            if self.local_manifest_path:
                remote_manifest = local_manifest
            else:
                log.FatalError(_("Fatal Error: Neither remote nor local "
                                 "manifest is readable."),
                               log.ErrorCode.unreadable_manifests)
        remote_manifest.check_dirinfo()

    def get_local_manifest(self):
        """
        Return manifest object by reading local manifest file
        """
        assert self.local_manifest_path
        manifest_buffer = self.local_manifest_path.get_data()
        return manifest.Manifest().from_string(manifest_buffer)

    def get_remote_manifest(self):
        """
        Return manifest by reading remote manifest on backend
        """
        assert self.remote_manifest_name
        # Following by MDR.  Should catch if remote encrypted with
        # public key w/o secret key
        try:
            manifest_buffer = self.backend.get_data(self.remote_manifest_name)

# Path: duplicity/globals.py

# 
# Path: duplicity/gpg.py
# class GPGError(Exception):
#     """
#     Indicate some GPG Error
#     """
#     pass


# Path: duplicity/collections.py
import types
import gettext
from duplicity import log
from duplicity import file_naming
from duplicity import path
from duplicity import dup_time
from duplicity import globals
from duplicity import manifest
from duplicity.gpg import GPGError

                log.FatalError(_("Fatal Error: Remote manifest does not match "
                                 "local one.  Either the remote backup set or "
                                 "the local archive directory has been corrupted."),
                               log.ErrorCode.mismatched_manifests)
        if not remote_manifest:
            if self.local_manifest_path:
                remote_manifest = local_manifest
            else:
                log.FatalError(_("Fatal Error: Neither remote nor local "
                                 "manifest is readable."),
                               log.ErrorCode.unreadable_manifests)
        remote_manifest.check_dirinfo()

    def get_local_manifest(self):
        """
        Return manifest object by reading local manifest file
        """
        assert self.local_manifest_path
        manifest_buffer = self.local_manifest_path.get_data()
        return manifest.Manifest().from_string(manifest_buffer)

    def get_remote_manifest(self):
        """
        Return manifest by reading remote manifest on backend
        """
        assert self.remote_manifest_name
        # Following by MDR.  Should catch if remote encrypted with
        # public key w/o secret key
        try:
            manifest_buffer = self.backend.get_data(self.remote_manifest_name)

        except GPGError, message: