tahoe-lafs/allmydata/encode.py

17 lines
466 B
Python
Raw Normal View History

2006-12-03 00:31:26 +00:00
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):
dl = []
2006-12-03 00:31:26 +00:00
data = self.infile.read()
for (peerid, bucket_num, remotebucket) in landlords:
dl.append(remotebucket.callRemote('write', data))
dl.append(remotebucket.callRemote('close'))
2006-12-03 00:31:26 +00:00
return defer.DeferredList(dl)