upload: pass options through to the encoder

This commit is contained in:
Brian Warner 2008-01-14 21:17:32 -07:00
parent cb76ed36f9
commit e65967da49
2 changed files with 5 additions and 4 deletions

View File

@ -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)

View File

@ -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)