From: Daira Hopwood Date: Wed, 23 Sep 2015 14:05:08 +0000 (+0100) Subject: Ignore files with ignorable names. X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=a498c9697cd07366be2f30265844dd0fe28a2b1a;p=tahoe-lafs%2Ftahoe-lafs.git Ignore files with ignorable names. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 10b56d8a..d48990c8 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -140,7 +140,7 @@ class QueueMixin(HookMixin): def _append_to_deque(self, relpath_u): print "_append_to_deque(%r)" % (relpath_u,) - if relpath_u in self._pending: + if relpath_u in self._pending or magicpath.should_ignore_file(relpath_u): return self._deque.append(relpath_u) self._pending.add(relpath_u) @@ -250,6 +250,9 @@ class Uploader(QueueMixin): d.addCallback(lambda ign, child=child: ("%s/%s" % (reldir_u, child) if reldir_u else child)) def _add_pending(relpath_u): + if magicpath.should_ignore_file(relpath_u): + return None + self._pending.add(relpath_u) return relpath_u d.addCallback(_add_pending) @@ -267,6 +270,8 @@ class Uploader(QueueMixin): return defer.succeed(None) def _process(self, relpath_u): + if relpath_u is None: + return precondition(isinstance(relpath_u, unicode), relpath_u) d = defer.succeed(None) @@ -407,6 +412,8 @@ class Downloader(QueueMixin): We check the remote metadata version against our magic-folder db version number; latest version wins. """ + if magicpath.should_ignore_file(relpath_u): + return False v = self._db.get_local_file_version(relpath_u) return (v is None or v < remote_version)