~mterry/duplicity/list-old-chains-0.6

« back to all changes in this revision

Viewing changes to duplicity/manifest.py

  • Committer: loafman
  • Date: 2008-12-22 17:22:44 UTC
  • Revision ID: vcs-imports@canonical.com-20081222172244-cjurdc0mt5d41n6d
patch #6700: Make duplicity translatable
https://savannah.nongnu.org/patch/?6700

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
Previous directory: %s""" % (self.local_dirname, globals.local_path.name)
60
60
        else: return
61
61
 
62
 
        log.FatalError(errmsg + """
63
 
 
64
 
Aborting because you may have accidentally tried to backup two
65
 
different data sets to the same remote location, or using the same
66
 
archive directory.  If this is not a mistake, use the
67
 
--allow-source-mismatch switch to avoid seeing this message""", log.ErrorCode.source_mismatch)
 
62
        log.FatalError(errmsg + "\n\n" +
 
63
                       _("Aborting because you may have accidentally tried to "
 
64
                         "backup two different data sets to the same remote "
 
65
                         "location, or using the same archive directory.  If "
 
66
                         "this is not a mistake, use the "
 
67
                         "--allow-source-mismatch switch to avoid seeing this "
 
68
                         "message"), log.ErrorCode.source_mismatch)
68
69
 
69
70
    def add_volume_info(self, vi):
70
71
        """Add volume info vi to manifest"""
116
117
        vi_list2 = other.volume_info_dict.keys()
117
118
        vi_list2.sort()
118
119
        if vi_list1 != vi_list2:
119
 
            log.Log("Manifests not equal because different volume numbers", 3)
 
120
            log.Log(_("Manifests not equal because different volume numbers"), 3)
120
121
            return None
121
122
        for i in range(len(vi_list1)):
122
123
            if not vi_list1[i] == vi_list2[i]: return None
229
230
            field_name = line_split[0].lower()
230
231
            other_fields = line_split[1:]
231
232
            if field_name == "Volume":
232
 
                log.Log("Warning, found extra Volume identifier", 2)
 
233
                log.Log(_("Warning, found extra Volume identifier"), 2)
233
234
                break
234
235
            elif field_name == "startingpath":
235
236
                self.start_index = string_to_index(other_fields[0])
245
246
    def __eq__(self, other):
246
247
        """Used in test suite"""
247
248
        if not isinstance(other, VolumeInfo):
248
 
            log.Log("Other is not VolumeInfo", 3)
 
249
            log.Log(_("Other is not VolumeInfo"), 3)
249
250
            return None
250
251
        if self.volume_number != other.volume_number:
251
 
            log.Log("Volume numbers don't match", 3)
 
252
            log.Log(_("Volume numbers don't match"), 3)
252
253
            return None
253
254
        if self.start_index != other.start_index:
254
 
            log.Log("start_indicies don't match", 3)
 
255
            log.Log(_("start_indicies don't match"), 3)
255
256
            return None
256
257
        if self.end_index != other.end_index:
257
 
            log.Log("end_index don't match", 3)
 
258
            log.Log(_("end_index don't match"), 3)
258
259
            return None
259
260
        hash_list1 = self.hashes.items()
260
261
        hash_list1.sort()
261
262
        hash_list2 = other.hashes.items()
262
263
        hash_list2.sort()
263
264
        if hash_list1 != hash_list2:
264
 
            log.Log("Hashes don't match", 3)
 
265
            log.Log(_("Hashes don't match"), 3)
265
266
            return None
266
267
        return 1
267
268