combox

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

commit f024a16d6f689d2ad4ed3420b58e78ffe88e94ae
parent 1f91f748cb2ff193011aaab714442298a231aa10
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Fri, 13 Mar 2015 12:48:48 -0400

updated on_created, on_modified, on_deleted methods in NodeDirMonitor.

Now they check if the event.src_path is a shard or a directory before
doing anything.

  modified:   combox/events.py

Diffstat:
combox/events.py | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/combox/events.py b/combox/events.py @@ -240,6 +240,11 @@ class NodeDirMonitor(LoggingEventHandler): super(NodeDirMonitor, self).on_created(event) self.silo_update() + if not self.shardp(event.src_path) and not event.is_directory: + # the file created can be ignored as it is not a shard or + # a directory. + return + file_cb_path = cb_path(event.src_path, self.config) if event.is_directory and (not path.exists(file_cb_path)): @@ -262,6 +267,11 @@ class NodeDirMonitor(LoggingEventHandler): super(NodeDirMonitor, self).on_deleted(event) self.silo_update() + if not self.shardp(event.src_path) and not event.is_directory: + # the file created can be ignored as it is not a shard or + # a directory. + return + file_cb_path = cb_path(event.src_path, self.config) if event.is_directory: @@ -278,6 +288,11 @@ class NodeDirMonitor(LoggingEventHandler): super(NodeDirMonitor, self).on_modified(event) self.silo_update() + if not self.shardp(event.src_path) and not event.is_directory: + # the file created can be ignored as it is not a shard or + # a directory. + return + file_cb_path = cb_path(event.src_path, self.config) if event.is_directory: