From 1b616c81e199a31a05900a28f69a08d91f91e3d5 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Sat, 2 Dec 2006 17:31:26 -0700 Subject: [PATCH] prototype encoder --- allmydata/encode.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 allmydata/encode.py 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() -- 2.45.2