From ef5cbad2f1aa2014853bde35596c0812d1c6b079 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Wed, 26 Aug 2015 09:54:19 -0400 Subject: combox/events.py: fixed Dropbox specific issue. --- combox/events.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/combox/events.py b/combox/events.py index 33ff9d9..7774bbd 100644 --- a/combox/events.py +++ b/combox/events.py @@ -300,16 +300,25 @@ class NodeDirMonitor(LoggingEventHandler): not event.is_directory): # The file moved is of no importance. return - if (not self.shardp(event.src_path) and - self.shardp(event.dest_path) and - not event.is_directory): + elif (not self.shardp(event.src_path) and + self.shardp(event.dest_path) and + not event.is_directory): # This is Dropbox specific. # # The file is renamed to a shard; so this the first time # the shard appears in this node directory -- it is # created. - silo_node_dict = 'file_created' + elif (self.shardp(event.src_path) and + self.shardp(event.dest_path) and + '.dropbox_cache' in event.dest_path and + not event.is_directory): + # This is Dropbox specific :| + # + # The shard is moved to the Dropbox's cache. This is happens + # when a shard is deleted in the Dropbox directory; so we must + # this treat as a file delete. + silo_node_dict = 'file_deleted' src_cb_path = cb_path(event.src_path, self.config) dest_cb_path = cb_path(event.dest_path, self.config) -- cgit v1.2.3