The initial_children= argument to nodemaker.create_new_mutable_directory is

now enabled.
This commit is contained in:
Brian Warner 2009-10-12 20:19:22 -07:00
parent c2520e4ec7
commit 480e1d318d
2 changed files with 3 additions and 5 deletions

View File

@ -479,9 +479,7 @@ class DirectoryNode:
assert isinstance(name, unicode)
if self.is_readonly():
return defer.fail(NotMutableError())
d = self._nodemaker.create_new_mutable_directory()
if initial_children:
d.addCallback(lambda n: n.set_children(initial_children))
d = self._nodemaker.create_new_mutable_directory(initial_children)
def _created(child):
entries = [(name, child, None)]
a = Adder(self, entries, overwrite=overwrite)

View File

@ -89,8 +89,8 @@ class NodeMaker:
return d
def create_new_mutable_directory(self, initial_children={}):
if initial_children:
raise NotImplementedError("initial_children= not implemented yet")
d = self.create_mutable_file()
d.addCallback(self._create_dirnode)
if initial_children:
d.addCallback(lambda n: n.set_children(initial_children))
return d