Commit d3f3f5e5 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

Add "move self" event (also triggered by rename) & fix bug when event cleans up its watch.

parent b9a3e57a
......@@ -532,6 +532,7 @@ class FileSystem(object):
if mtime == -1:
for combined_id in event.watch.listener:
del self._monitor_listener[combined_id]
event.watch.listener = []
self._check_watch(event.watch)
def _check_watch(self, watch):
......
......@@ -31,15 +31,16 @@ class FSEvent(object):
def user(self):
return self.watch.user
Access = 0x01
Modify = 0x02
Attrib = 0x04
Create = 0x08
Delete = 0x10
DeleteSelf = 0x20
MoveFrom = 0x40
MoveTo = 0x80
All = 0xFF
Access = 0x001
Modify = 0x002
Attrib = 0x004
Create = 0x008
Delete = 0x010
DeleteSelf = 0x020
MoveFrom = 0x040
MoveTo = 0x080
MoveSelf = 0x100
All = 0x1FF
action_names = {
Access : "access",
......@@ -50,4 +51,5 @@ class FSEvent(object):
DeleteSelf : "delete self",
MoveFrom : "move from",
MoveTo : "move to",
MoveSelf : "move self",
}
......@@ -62,6 +62,7 @@ action_map = {
IN_ATTRIB : FSEvent.Attrib,
IN_MOVED_FROM : FSEvent.MoveFrom,
IN_MOVED_TO : FSEvent.MoveTo,
IN_MOVE_SELF : FSEvent.MoveSelf,
IN_CREATE : FSEvent.Create,
IN_DELETE : FSEvent.Delete,
IN_DELETE_SELF : FSEvent.DeleteSelf,
......@@ -76,6 +77,7 @@ flags_map = {
FSEvent.DeleteSelf : IN_DELETE_SELF,
FSEvent.MoveFrom : IN_MOVED_FROM,
FSEvent.MoveTo : IN_MOVED_TO,
FSEvent.MoveSelf : IN_MOVE_SELF,
}
def convert_flags(flags):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment