client.create_mutable_file(contents=) now accepts a callable, which is

invoked with the new MutableFileNode and is supposed to return the initial
contents. This can be used by e.g. a new dirnode which needs the filenode's
writekey to encrypt its initial children.

create_mutable_file() still accepts a bytestring too, or None for an empty
file.
This commit is contained in:
Brian Warner
2009-10-12 20:12:32 -07:00
parent b30041c5ec
commit c2520e4ec7
5 changed files with 45 additions and 7 deletions

View File

@ -463,7 +463,7 @@ class Client(node.Node, pollmixin.PollMixin):
d.addCallback(lambda n: n.set_children(initial_children))
return d
def create_mutable_file(self, contents="", keysize=None):
def create_mutable_file(self, contents=None, keysize=None):
return self.nodemaker.create_mutable_file(contents, keysize)
def upload(self, uploadable):