'Monitor a file and make a callback if it has changed.'

def _monitor(self):

    self._call = None
    if (self.index is not None):
        (name, callback, mtime) = self.files[self.index][1:]
        try:
            now = os.path.getmtime(name)
        except:
            now = 0
        if (now > mtime):
            log.msg(('%s    changed,    notifying    listener' % (name,)))
            self.files[self.index][3] = now
            callback(name)
    self._setupMonitor()
