diff options
author | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-08-26 09:54:19 -0400 |
---|---|---|
committer | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-08-26 09:54:19 -0400 |
commit | ef5cbad2f1aa2014853bde35596c0812d1c6b079 (patch) | |
tree | c689b20d9dd81c42053f1fa5af4544124fd38b7f | |
parent | 3d714c5cf767b23d56a18f704608df31b3b0ac2a (diff) |
combox/events.py: fixed Dropbox specific issue.
-rw-r--r-- | combox/events.py | 17 |
1 files 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) |