From: David Stainton Date: Mon, 1 Jun 2015 16:19:42 +0000 (-0700) Subject: WIP X-Git-Url: https://git.rkrishnan.org/simplejson/components/%22file:/something?a=commitdiff_plain;h=9ab1c2bcb4d3b5e6e5bbe8cf129ce8b6abe334ea;p=tahoe-lafs%2Ftahoe-lafs.git WIP --- diff --git a/src/allmydata/frontends/drop_upload.py b/src/allmydata/frontends/drop_upload.py index 815c5084..ee9e5783 100644 --- a/src/allmydata/frontends/drop_upload.py +++ b/src/allmydata/frontends/drop_upload.py @@ -93,6 +93,7 @@ class DropUploader(service.MultiService): #self.mask = inotify.IN_CLOSE_WRITE | inotify.IN_MOVED_TO | inotify.IN_ONLYDIR #self.mask = inotify.IN_CLOSE_WRITE | inotify.IN_MOVED_TO | inotify.IN_MOVED_FROM | inotify.IN_ONLYDIR | IN_EXCL_UNLINK self.mask = inotify.IN_CLOSE_WRITE | inotify.IN_MOVED_TO | inotify.IN_ONLYDIR | IN_EXCL_UNLINK | inotify.IN_DELETE + #self.mask = inotify.IN_CLOSE_WRITE | inotify.IN_MOVED_TO | inotify.IN_ONLYDIR | IN_EXCL_UNLINK self._notifier.watch(self._local_path, mask=self.mask, callbacks=[self._notify], recursive=True) @@ -204,7 +205,10 @@ class DropUploader(service.MultiService): return self._parent.add_file(name, u) def _add_dir(ignore, name): - self._notifier.watch(to_filepath(path), mask=self.mask, callbacks=[self._notify], recursive=True) + # XXX + #self._notifier.watch(to_filepath(path), mask=self.mask, callbacks=[self._notify], recursive=True) + print name + print self._local_dir d2 = self._parent.create_subdirectory(name, overwrite=False) def _err(f): f.trap(ExistingChildError) @@ -296,4 +300,5 @@ class DropUploader(service.MultiService): def _log(self, msg): self._client.log(msg) + print "_log:", msg #open("events", "ab+").write(msg) diff --git a/src/allmydata/test/test_drop_upload.py b/src/allmydata/test/test_drop_upload.py index 631136ee..1455ccc7 100644 --- a/src/allmydata/test/test_drop_upload.py +++ b/src/allmydata/test/test_drop_upload.py @@ -275,7 +275,7 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.directories_created'), 1)) d.addBoth(self._cleanup) return d - + def test_drop_upload(self): self.set_up_grid() self.local_dir = os.path.join(self.basedir, self.unicode_or_fallback(u"loc\u0101l_dir", u"local_dir"))