From d5ed60e4add666b9b526a156035b4fb72e536ddc Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 15 Sep 2007 12:49:07 -0700 Subject: [PATCH] webish: upload: when the localdir= doesn't exist, say so in the HTTP response --- src/allmydata/webish.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index 6d1fa382..9b6639e2 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -833,6 +833,9 @@ class PUTHandler(rend.Page): # build up a list of files to upload all_files = [] all_dirs = [] + msg = "No files to upload! %s is empty" % localdir + if not os.path.exists(localdir): + msg = "%s doesn't exist!" % localdir for root, dirs, files in os.walk(localdir): if root == localdir: path = () @@ -843,7 +846,7 @@ class PUTHandler(rend.Page): all_dirs.append(path + (d,)) for f in files: all_files.append(path + (f,)) - d = defer.succeed(None) + d = defer.succeed(msg) for dir in all_dirs: if dir: d.addCallback(self._makedir, node, dir) -- 2.45.2