From: Zooko O'Whielacronx Date: Sun, 3 Dec 2006 00:31:26 +0000 (-0700) Subject: prototype encoder X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~494 X-Git-Url: https://git.rkrishnan.org/class-simplejson.JSONDecoder-index.html?a=commitdiff_plain;h=1b616c81e199a31a05900a28f69a08d91f91e3d5;p=tahoe-lafs%2Ftahoe-lafs.git prototype encoder --- diff --git a/allmydata/encode.py b/allmydata/encode.py new file mode 100644 index 00000000..946db1e0 --- /dev/null +++ b/allmydata/encode.py @@ -0,0 +1,15 @@ +from twisted.internet import defer + +class Encoder(object): + def __init__(self, infile, m): + self.infile = infile + self.k = 2 + self.m = m + + def do_upload(self, landlords): + data = self.infile.read() + for (peerid, bucket_num, remotebucket) in landlords: + remotebucket.callRemote('write', data) + remotebucket.callRemote('finalise') + + return defer.succeed()