]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
prototype encoder
authorZooko O'Whielacronx <zooko@zooko.com>
Sun, 3 Dec 2006 00:31:26 +0000 (17:31 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Sun, 3 Dec 2006 00:31:26 +0000 (17:31 -0700)
allmydata/encode.py [new file with mode: 0644]

diff --git a/allmydata/encode.py b/allmydata/encode.py
new file mode 100644 (file)
index 0000000..946db1e
--- /dev/null
@@ -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()