mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 11:16:24 +00:00
expand partial/lambda into full functions for clarity
This commit is contained in:
parent
5a0c913f58
commit
e0fa228622
@ -19,9 +19,6 @@ except ImportError:
|
||||
pass
|
||||
|
||||
import os, time, weakref, itertools
|
||||
from functools import (
|
||||
partial,
|
||||
)
|
||||
|
||||
import attr
|
||||
|
||||
@ -1076,8 +1073,18 @@ class EncryptAnUploadable(object):
|
||||
d.addCallback(lambda ignored: self._get_encryptor())
|
||||
|
||||
accum = _Accum(length)
|
||||
action = partial(self._read_encrypted, accum, hash_only)
|
||||
condition = lambda: accum.remaining == 0
|
||||
|
||||
def action():
|
||||
"""
|
||||
Read some bytes into the accumulator.
|
||||
"""
|
||||
return self._read_encrypted(accum, hash_only)
|
||||
|
||||
def condition():
|
||||
"""
|
||||
Check to see if the accumulator has all the data.
|
||||
"""
|
||||
return accum.remaining == 0
|
||||
|
||||
d.addCallback(lambda ignored: until(action, condition))
|
||||
d.addCallback(lambda ignored: accum.ciphertext)
|
||||
|
Loading…
Reference in New Issue
Block a user