Try catched pyinotify's addMonitor (thanks William Witt)
This commit is contained in:
parent
4d7d61217c
commit
676dba72da
@ -23,11 +23,13 @@ if hasInotify:
|
|||||||
|
|
||||||
|
|
||||||
def addMonitor( self, filename, callback, args = None ):
|
def addMonitor( self, filename, callback, args = None ):
|
||||||
mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY
|
try:
|
||||||
mId = self.wm.add_watch( filename, mask, rec = True)[filename]
|
mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY
|
||||||
if mId >= 0:
|
mId = self.wm.add_watch( filename, mask, rec = True)[filename]
|
||||||
self.callbacks[mId] = ( callback, args )
|
if mId >= 0:
|
||||||
|
self.callbacks[mId] = ( callback, args )
|
||||||
|
except Exception, detail:
|
||||||
|
mId = 0
|
||||||
return mId
|
return mId
|
||||||
|
|
||||||
def removeMonitor( self, monitorId ):
|
def removeMonitor( self, monitorId ):
|
||||||
|
Loading…
Reference in New Issue
Block a user