From 99479226edc007ad174d605e63355e2e907a8acb Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 23 Jun 2014 13:54:07 -0700 Subject: [PATCH] hush current pyflakes warnings (list comprehensions) closes #2245 --- misc/operations_helpers/find-share-anomalies.py | 1 + src/allmydata/immutable/downloader/node.py | 3 +-- src/allmydata/scripts/tahoe_cp.py | 1 + src/allmydata/storage/expirer.py | 1 + src/allmydata/test/check_load.py | 1 + src/allmydata/web/status.py | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/misc/operations_helpers/find-share-anomalies.py b/misc/operations_helpers/find-share-anomalies.py index 76fe3419..8dca5113 100644 --- a/misc/operations_helpers/find-share-anomalies.py +++ b/misc/operations_helpers/find-share-anomalies.py @@ -29,6 +29,7 @@ for catalog in sys.argv[1:]: sdmf_versions[si][0].add( ver ) sdmf_versions[si][1].add( line ) +del si chk_multiple_encodings = [(si,lines) for si,(encodings,lines) in chk_encodings.items() if len(encodings) > 1] diff --git a/src/allmydata/immutable/downloader/node.py b/src/allmydata/immutable/downloader/node.py index e852fd35..fe00fdbd 100644 --- a/src/allmydata/immutable/downloader/node.py +++ b/src/allmydata/immutable/downloader/node.py @@ -56,8 +56,7 @@ class DownloadNode: self._history = history self._download_status = download_status - k, N = self._verifycap.needed_shares, self._verifycap.total_shares - self.share_hash_tree = IncompleteHashTree(N) + self.share_hash_tree = IncompleteHashTree(self._verifycap.total_shares) # we guess the segment size, so Segmentation can pull non-initial # segments in a single roundtrip. This populates diff --git a/src/allmydata/scripts/tahoe_cp.py b/src/allmydata/scripts/tahoe_cp.py index 1ad460d8..cf421ae0 100644 --- a/src/allmydata/scripts/tahoe_cp.py +++ b/src/allmydata/scripts/tahoe_cp.py @@ -469,6 +469,7 @@ class Copier: name, source = self.get_source_info(ss) sources.append( (name, source) ) + del name have_source_dirs = bool([s for (name,s) in sources if isinstance(s, (LocalDirectorySource, TahoeDirectorySource))]) diff --git a/src/allmydata/storage/expirer.py b/src/allmydata/storage/expirer.py index 41823e7e..a284d4f7 100644 --- a/src/allmydata/storage/expirer.py +++ b/src/allmydata/storage/expirer.py @@ -144,6 +144,7 @@ class LeaseCheckingCrawler(ShareCrawler): self.increment(rec, "examined-buckets", 1) if sharetype: self.increment(rec, "examined-buckets-"+sharetype, 1) + del wks try: bucket_diskbytes = s.st_blocks * 512 diff --git a/src/allmydata/test/check_load.py b/src/allmydata/test/check_load.py index 197b3697..4674844b 100644 --- a/src/allmydata/test/check_load.py +++ b/src/allmydata/test/check_load.py @@ -52,6 +52,7 @@ if sys.argv[1] == "--stats": if name not in stats: stats[name] = 0 stats[name] += float(value) + del name if last_stats: delta = dict( [ (name,stats[name]-last_stats[name]) for name in stats ] ) diff --git a/src/allmydata/web/status.py b/src/allmydata/web/status.py index 89e6b640..b363f857 100644 --- a/src/allmydata/web/status.py +++ b/src/allmydata/web/status.py @@ -428,6 +428,7 @@ class DownloadStatusPage(DownloadResultsRendererMixin, rend.Page): rows[free_slot] = ev["finish_time"] ev["row"] = (groupnum, free_slot) new_events.append(ev) + del groupnum # maybe also return serverid_to_group, groupnum_to_rows, and some # indication of the highest finish_time # -- 2.45.2