combox

split and encrypted files between online file storage providers
git clone git://git.ricketyspace.net/combox.git
Log | Files | Refs

commit ef5cbad2f1aa2014853bde35596c0812d1c6b079
parent 3d714c5cf767b23d56a18f704608df31b3b0ac2a
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Wed, 26 Aug 2015 09:54:19 -0400

combox/events.py: fixed Dropbox specific issue.

Diffstat:
combox/events.py | 17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git 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)