From c476c66b0ea37912968486318b4b5bd16d8123eb Mon Sep 17 00:00:00 2001 From: kevan Date: Fri, 17 Jul 2009 20:00:10 -0700 Subject: [PATCH] Add 'only_files' option to the overwrite field in Adder --- src/allmydata/dirnode.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/allmydata/dirnode.py b/src/allmydata/dirnode.py index b06836f3..117c80e4 100644 --- a/src/allmydata/dirnode.py +++ b/src/allmydata/dirnode.py @@ -98,6 +98,9 @@ class Adder: if name in children: if not self.overwrite: raise ExistingChildError("child '%s' already exists" % name) + + if self.overwrite == "only_files" and IDirectoryNode.providedBy(children[name][0]): + raise ExistingChildError("child '%s' already exists" % name) metadata = children[name][1].copy() else: metadata = {"ctime": now, -- 2.45.2