mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 09:18:53 +00:00
16 lines
424 B
Python
16 lines
424 B
Python
|
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()
|