Author: tack
Date: Wed Apr 18 23:34:35 2007
New Revision: 2644

Modified:
   trunk/base/src/config.py

Log:
Log when monitored config file has changed.


Modified: trunk/base/src/config.py
==============================================================================
--- trunk/base/src/config.py    (original)
+++ trunk/base/src/config.py    Wed Apr 18 23:34:35 2007
@@ -858,7 +858,14 @@
 
     def _file_changed(self, mask, path):
         if mask & (INotify.MODIFY | INotify.ATTRIB):
+            # Config file changed.  Attach a monitor so we can keep track of
+            # any values that actually changed.
+            changed_names = []
+            cb = Callback(lambda *args: changed_names.append(args[0]))
+            self.add_monitor(cb)
             self.load()
+            log.info('Config file %s modified; %d values changed.' % 
(self._filename, len(changed_names)))
+            self.remove_monitor(cb)
         elif mask & (INotify.IGNORED | INotify.MOVE_SELF):
             # File may have been replaced, check mtime now.
             WeakOneShotTimer(self._check_file_changed).start(0.1)

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to