]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
upload: pass options through to the encoder
authorBrian Warner <warner@allmydata.com>
Tue, 15 Jan 2008 04:17:32 +0000 (21:17 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 15 Jan 2008 04:17:32 +0000 (21:17 -0700)
src/allmydata/client.py
src/allmydata/upload.py

index 1d7958ab1afec80154bb668d9a19b30484fbb703..50ed9a057ca224af295d97115adda200d336379c 100644 (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)
 
index 01877cc89ab2634e723b4b2391c6b3cd802d31fb..a0ef6af7700ca4e0da9bcca0c08ba84d61981f33 100644 (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)