mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-09 03:44:23 +00:00
upload: pass options through to the encoder
This commit is contained in:
parent
cb76ed36f9
commit
e65967da49
@ -253,7 +253,7 @@ class Client(node.Node, Referenceable, testutil.PollMixin):
|
||||
d.addCallback(lambda res: n)
|
||||
return d
|
||||
|
||||
def upload(self, uploadable):
|
||||
def upload(self, uploadable, options={}):
|
||||
uploader = self.getServiceNamed("uploader")
|
||||
return uploader.upload(uploadable)
|
||||
return uploader.upload(uploadable, options)
|
||||
|
||||
|
@ -311,8 +311,9 @@ class EncryptAnUploadable:
|
||||
IEncryptedUploadable."""
|
||||
implements(IEncryptedUploadable)
|
||||
|
||||
def __init__(self, original):
|
||||
def __init__(self, original, options={}):
|
||||
self.original = original
|
||||
self._options = options
|
||||
self._encryptor = None
|
||||
self._plaintext_hasher = plaintext_hasher()
|
||||
self._plaintext_segment_hasher = None
|
||||
@ -586,7 +587,7 @@ class AssistedUploader:
|
||||
|
||||
def start(self, uploadable):
|
||||
u = IUploadable(uploadable)
|
||||
eu = IEncryptedUploadable(EncryptAnUploadable(u))
|
||||
eu = IEncryptedUploadable(EncryptAnUploadable(u, self._options))
|
||||
self._encuploadable = eu
|
||||
d = eu.get_size()
|
||||
d.addCallback(self._got_size)
|
||||
|
Loading…
x
Reference in New Issue
Block a user