From 190743e066ea024ad506df51c8bf5981d3c86c09 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 17 Mar 2015 11:13:33 -0700 Subject: [PATCH] tahoe_cp: minor cleanups, no behavior changes --- src/allmydata/scripts/tahoe_cp.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/allmydata/scripts/tahoe_cp.py b/src/allmydata/scripts/tahoe_cp.py index f55279be..30892392 100644 --- a/src/allmydata/scripts/tahoe_cp.py +++ b/src/allmydata/scripts/tahoe_cp.py @@ -778,7 +778,7 @@ class Copier: subtarget = target.get_child_target(name) self.assign_targets(targetmap, child, subtarget) else: - precondition(isinstance(child, FileSources), child) + _assert(isinstance(child, FileSources), child) targetmap[target].append(child) def copy_to_targetmap(self, targetmap): @@ -789,9 +789,9 @@ class Copier: targets_finished = 0 for target, sources in targetmap.items(): - precondition(isinstance(target, DirectoryTargets), target) + _assert(isinstance(target, DirectoryTargets), target) for source in sources: - precondition(isinstance(source, FileSources), source) + _assert(isinstance(source, FileSources), source) self.copy_file_into_dir(source, source.basename(), target) files_copied += 1 self.progress("%d/%d files, %d/%d directories" % @@ -803,8 +803,7 @@ class Copier: (targets_finished, len(targetmap))) def count_files_to_copy(self, targetmap): - files_to_copy = sum([len(sources) for sources in targetmap.values()]) - return files_to_copy + return sum([len(sources) for sources in targetmap.values()]) def copy_file_into_dir(self, source, name, target): precondition(isinstance(source, FileSources), source) -- 2.45.2