From 480e1d318dd4661902e343dfd94405ead512a06f Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Mon, 12 Oct 2009 20:19:22 -0700 Subject: [PATCH] The initial_children= argument to nodemaker.create_new_mutable_directory is now enabled. --- src/allmydata/dirnode.py | 4 +--- src/allmydata/nodemaker.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/allmydata/dirnode.py b/src/allmydata/dirnode.py index ba6d5528..dfb2f1b5 100644 --- a/src/allmydata/dirnode.py +++ b/src/allmydata/dirnode.py @@ -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) diff --git a/src/allmydata/nodemaker.py b/src/allmydata/nodemaker.py index 01fdd72a..8a0baf43 100644 --- a/src/allmydata/nodemaker.py +++ b/src/allmydata/nodemaker.py @@ -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 -- 2.45.2