From: Brian Warner Date: Thu, 17 Jan 2008 08:17:42 +0000 (-0700) Subject: upload.py: make it easier to have an IUploadable that overrides encoding parameters... X-Git-Tag: allmydata-tahoe-0.8.0~297 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/running.html?a=commitdiff_plain;h=6b08c28f5d9b583af1957055e758fbb39121395e;p=tahoe-lafs%2Ftahoe-lafs.git upload.py: make it easier to have an IUploadable that overrides encoding parameters: just set an attribute instead of subclassing --- diff --git a/src/allmydata/upload.py b/src/allmydata/upload.py index f0774301..107d4c64 100644 --- a/src/allmydata/upload.py +++ b/src/allmydata/upload.py @@ -787,10 +787,12 @@ class AssistedUploader: return u.to_string() class NoParameterPreferencesMixin: + max_segment_size = None + encoding_parameters = None def get_maximum_segment_size(self): - return defer.succeed(None) + return defer.succeed(self.max_segment_size) def get_encoding_parameters(self): - return defer.succeed(None) + return defer.succeed(self.encoding_parameters) class ConvergentUploadMixin: # to use this, the class it is mixed in to must have a seekable