From e65967da49a8232c7d684acfc2768cc03ff04743 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 14 Jan 2008 21:17:32 -0700 Subject: [PATCH] upload: pass options through to the encoder --- src/allmydata/client.py | 4 ++-- src/allmydata/upload.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 1d7958ab..50ed9a05 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -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) diff --git a/src/allmydata/upload.py b/src/allmydata/upload.py index 01877cc8..a0ef6af7 100644 --- a/src/allmydata/upload.py +++ b/src/allmydata/upload.py @@ -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) -- 2.45.2