From c427b880d2789c8673300b472f58d16238cee8a0 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Thu, 1 Feb 2007 16:30:13 -0700 Subject: [PATCH] update the use of the encoder API in download.py --- src/allmydata/download.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/allmydata/download.py b/src/allmydata/download.py index ef855d15..0810c962 100644 --- a/src/allmydata/download.py +++ b/src/allmydata/download.py @@ -113,19 +113,21 @@ class FileDownloader: # retrieve all shares dl = [] shares = [] + shareids = [] for (bucket_num, bucket) in all_buckets: d0 = bucket.callRemote("get_metadata") d1 = bucket.callRemote("read") d2 = DeferredListShouldSucceed([d0, d1]) def _got(res): - sharenum_s, sharedata = res - sharenum = bencode.bdecode(sharenum_s) - shares.append((sharenum, sharedata)) + shareid_s, sharedata = res + shareid = bencode.bdecode(shareid_s) + shares.append(sharedata) + shareids.append(shareid) d2.addCallback(_got) dl.append(d2) d = DeferredListShouldSucceed(dl) - d.addCallback(lambda res: self._decoder.decode(shares)) + d.addCallback(lambda res: self._decoder.decode(shares, shareids)) def _write(decoded_shares): data = "".join(decoded_shares) -- 2.45.2