From 676dba72da5024c243d5924d5a157c0ab379cf0b Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Thu, 23 Sep 2010 10:05:48 +0100 Subject: [PATCH] Try catched pyinotify's addMonitor (thanks William Witt) --- usr/lib/linuxmint/mintMenu/plugins/filemonitor.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py b/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py index 7a32aac..bd0f124 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py +++ b/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py @@ -23,11 +23,13 @@ if hasInotify: def addMonitor( self, filename, callback, args = None ): - mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY - mId = self.wm.add_watch( filename, mask, rec = True)[filename] - if mId >= 0: - self.callbacks[mId] = ( callback, args ) - + try: + mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY + mId = self.wm.add_watch( filename, mask, rec = True)[filename] + if mId >= 0: + self.callbacks[mId] = ( callback, args ) + except Exception, detail: + mId = 0 return mId def removeMonitor( self, monitorId ):