summaryrefslogtreecommitdiffstats
path: root/combox/events.py
diff options
context:
space:
mode:
Diffstat (limited to 'combox/events.py')
-rw-r--r--combox/events.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/combox/events.py b/combox/events.py
index 5cdd54f..12d0cbe 100644
--- a/combox/events.py
+++ b/combox/events.py
@@ -235,6 +235,21 @@ class NodeDirMonitor(LoggingEventHandler):
super(NodeDirMonitor, self).on_moved(event)
self.silo_update()
+ src_cb_path = cb_path(event.src_path, self.config)
+ dest_cb_path = cb_path(event.dest_path, self.config)
+
+ if not path.exists(dest_cb_path):
+ # means this path was move on another computer that is
+ # running combox.
+ try:
+ os.rename(src_cb_path, dest_cb_path)
+ except OSError, e:
+ print "Jeez, failed to rename path.", e
+
+ if not event.is_directory:
+ self.silo.remove(src_cb_path)
+ self.silo.update(dest_cb_path)
+
def on_created(self, event):
super(NodeDirMonitor, self).on_created(event)