'Register function that will be run when file changes.
:param function function:
Function that will be called when file at the given path changes.
:param str path:
Path that will be watched for.'

def register(self, function, path):

    with self.lock:
        self.watched[path].add(function)
        self.watcher.watch(path)
