combox

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

commit 8c86e7c28738c66c0e04ae7886b44dbcdfc6369e
parent 8bb9f4568645771f464cf266a1b80146118a458e
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Mon, 21 Dec 2015 19:46:26 -0500

Accounted for watchdog's weirdess.

This fixes two tests that were failing on OS X.

Diffstat:
combox/events.py | 24++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/combox/events.py b/combox/events.py @@ -225,7 +225,17 @@ class ComboxDirMonitor(LoggingEventHandler): else: time.sleep(1) - if self.just_created[event.src_path]: + # watchdog's weirdness + # -------------------- + # + # On GNU/Linux, when a file is created, watchdog + # generates a 'file created' and a 'file modified' + # event; we're tracking this behaviour and ignoring + # the 'file modified' event. + # + if (self.just_created.has_key(event.src_path) and + self.just_created[event.src_path] and + platform.system() == 'Linux'): self.just_created[event.src_path] = False log_i("Just created file %s. So ignoring on_modified call." % ( event.src_path)) @@ -664,7 +674,17 @@ class NodeDirMonitor(LoggingEventHandler): else: time.sleep(1) - if self.just_created[event.src_path]: + # watchdog's weirdness + # -------------------- + # + # On GNU/Linux, when a file is created, watchdog generates + # a 'file created' and 'file modified' event; we're + # tracking this behaviour and ignoring the 'file modified' + # event. + # + if (self.just_created.has_key(event.src_path) and + self.just_created[event.src_path] and + platform.system() == 'Linux'): self.just_created[event.src_path] = False log_i("Just created file %s; ignoring on_modified call." % ( event.src_path))