]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
webish: upload: when the localdir= doesn't exist, say so in the HTTP response
authorBrian Warner <warner@lothar.com>
Sat, 15 Sep 2007 19:49:07 +0000 (12:49 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 15 Sep 2007 19:49:07 +0000 (12:49 -0700)
src/allmydata/webish.py

index 6d1fa382976ff1960c1b64de289f649b6b85af8b..9b6639e2be7b4f9cfe88e116a1ee87690edcbca7 100644 (file)
@@ -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)