~duplicity-team/duplicity/0.7-series

« back to all changes in this revision

Viewing changes to bin/duplicity

  • Committer: Kenneth Loafman
  • Date: 2015-01-01 13:07:31 UTC
  • Revision ID: kenneth@loafman.com-20150101130731-6i3lb8r9rz4qpz2y
* Misc fixes for the following PEP8 issues:
   - E211, E221, E222, E225, E226, E228
   - see http://pep8.readthedocs.org

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
                    break
238
238
            if tarblock_iter.previous_index > last_index:
239
239
                log.Warn(_("File %s complete in backup set.\n"
240
 
                           "Continuing restart on file %s.") %
 
240
                           "Continuing restart on file %s.") % 
241
241
                           (util.uindex(last_index), util.uindex(tarblock_iter.previous_index)),
242
242
                           log.ErrorCode.restart_file_not_found)
243
243
                # We went too far! Stuff the data back into place before restarting
246
246
            iter_result = tarblock_iter.next()
247
247
    except StopIteration:
248
248
        log.Warn(_("File %s missing in backup set.\n"
249
 
                   "Continuing restart on file %s.") %
 
249
                   "Continuing restart on file %s.") % 
250
250
                   (util.uindex(last_index), util.uindex(tarblock_iter.previous_index)),
251
251
                   log.ErrorCode.restart_file_not_found)
252
252
 
351
351
        validate_encryption_settings(globals.restart.last_backup, mf)
352
352
        mf.fh = man_outfp
353
353
        last_block = globals.restart.last_block
354
 
        log.Notice(_("Restarting after volume %s, file %s, block %s") %
 
354
        log.Notice(_("Restarting after volume %s, file %s, block %s") % 
355
355
                   (globals.restart.start_vol,
356
356
                    util.uindex(globals.restart.last_index),
357
357
                    globals.restart.last_block))
760
760
    """ verify hash of the remote file """
761
761
    verified, hash_pair, calculated_hash = restore_check_hash(volume_info, tdp)
762
762
    if not verified:
763
 
        log.FatalError("%s\n %s\n %s\n %s\n" %
 
763
        log.FatalError("%s\n %s\n %s\n %s\n" % 
764
764
                       (_("Invalid data - %s hash mismatch for file:") % hash_pair[0],
765
765
                        util.ufn(filename),
766
766
                        _("Calculated hash: %s") % calculated_hash,
802
802
        """Thunk run when closing volume file"""
803
803
        actual_sig = fileobj.fileobj.get_signature()
804
804
        if actual_sig != globals.gpg_profile.sign_key:
805
 
            log.FatalError(_("Volume was signed by key %s, not %s") %
 
805
            log.FatalError(_("Volume was signed by key %s, not %s") % 
806
806
                           (actual_sig, globals.gpg_profile.sign_key),
807
807
                           log.ErrorCode.unsigned_volume)
808
808
    fileobj.addhook(check_signature)
832
832
        total_count += 1
833
833
    # Unfortunately, ngettext doesn't handle multiple number variables, so we
834
834
    # split up the string.
835
 
    log.Notice(_("Verify complete: %s, %s.") %
 
835
    log.Notice(_("Verify complete: %s, %s.") % 
836
836
               (ngettext("%d file compared",
837
837
                         "%d files compared", total_count) % total_count,
838
838
                ngettext("%d difference found",
917
917
 
918
918
    req_list = col_stats.get_older_than_required(globals.remove_time)
919
919
    if req_list:
920
 
        log.Warn("%s\n%s\n%s" %
 
920
        log.Warn("%s\n%s\n%s" % 
921
921
                 (_("There are backup set(s) at time(s):"),
922
922
                  set_times_str(req_list),
923
923
                  _("Which can't be deleted because newer sets depend on them.")))
935
935
    if globals.force:
936
936
        log.Notice(ngettext("Deleting backup chain at time:",
937
937
                            "Deleting backup chains at times:",
938
 
                            len(chainlist)) +
 
938
                            len(chainlist)) + 
939
939
                   "\n" + chain_times_str(chainlist))
940
940
        # Add signature files too, since they won't be needed anymore
941
941
        chainlist += col_stats.get_signature_chains_older_than(globals.remove_time)
959
959
    else:
960
960
        log.Notice(ngettext("Found old backup chain at the following time:",
961
961
                            "Found old backup chains at the following times:",
962
 
                            len(chainlist)) +
963
 
                   "\n" + chain_times_str(chainlist) + "\n" +
 
962
                            len(chainlist)) + 
 
963
                   "\n" + chain_times_str(chainlist) + "\n" + 
964
964
                   _("Rerun command with --force option to actually delete."))
965
965
 
966
966
 
1070
1070
                        name = self.fileobj.name
1071
1071
                    else:
1072
1072
                        name = None
1073
 
                    log.FatalError(_("Failed to read %s: %s") %
 
1073
                    log.FatalError(_("Failed to read %s: %s") % 
1074
1074
                                   (util.ufn(name), sys.exc_info()),
1075
1075
                                   log.ErrorCode.generic)
1076
1076
                if not res.data:
1206
1206
        needspace = (((globals.async_concurrency + 1) * globals.volsize)
1207
1207
                     + int(0.30 * globals.volsize))
1208
1208
        if freespace < needspace:
1209
 
            log.FatalError(_("Temp space has %d available, backup needs approx %d.") %
 
1209
            log.FatalError(_("Temp space has %d available, backup needs approx %d.") % 
1210
1210
                           (freespace, needspace), log.ErrorCode.not_enough_freespace)
1211
1211
        else:
1212
 
            log.Info(_("Temp has %d available, backup will use approx %d.") %
 
1212
            log.Info(_("Temp has %d available, backup will use approx %d.") % 
1213
1213
                     (freespace, needspace))
1214
1214
 
1215
1215
        # Some environments like Cygwin run with an artificially
1277
1277
            elif mf_len - self.start_vol > 0:
1278
1278
                # upload of N vols failed, fix manifest and restart
1279
1279
                log.Notice(_("RESTART: Volumes %d to %d failed to upload before termination.\n"
1280
 
                             "         Restarting backup at volume %d.") %
 
1280
                             "         Restarting backup at volume %d.") % 
1281
1281
                             (self.start_vol + 1, mf_len, self.start_vol + 1))
1282
1282
                for vol in range(self.start_vol + 1, mf_len + 1):
1283
1283
                    mf.del_volume_info(vol)
1285
1285
                # this is an 'impossible' state, remove last partial and restart
1286
1286
                log.Notice(_("RESTART: Impossible backup state: manifest has %d vols, remote has %d vols.\n"
1287
1287
                             "         Restart is impossible ... duplicity will clean off the last partial\n"
1288
 
                             "         backup then restart the backup from the beginning.") %
 
1288
                             "         backup then restart the backup from the beginning.") % 
1289
1289
                             (mf_len, self.start_vol))
1290
1290
                self.last_backup.delete()
1291
1291
                os.execve(sys.argv[0], sys.argv, os.environ)