From: Zooko O'Whielacronx Date: Thu, 1 Feb 2007 23:30:13 +0000 (-0700) Subject: update the use of the encoder API in download.py X-Git-Url: https://git.rkrishnan.org/vdrive/components/com_hotproperty/frontends/?a=commitdiff_plain;h=c427b880d2789c8673300b472f58d16238cee8a0;p=tahoe-lafs%2Ftahoe-lafs.git update the use of the encoder API in download.py --- 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)