Open GoogleCodeExporter opened 9 years ago
[Watchdog](https://github.com/gorakhargosh/watchdog) seems to help a lot on
that.
Here is a script which does that so it should be easy to incorporate it in
fabricate:
import sys
import time
from watchdog.observers import Observer
from watchdog.tricks import ShellCommandTrick
if __name__ == __main__:
event_handler = ShellCommandTrick(shell_command='python build.py', wait_for_process=True)
observer = Observer()
observer.schedule(event_handler, '.', recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
It has a possible issue, when you touch a file it'll be recorded as a CREATE
followed right after by a MODIFY event. There should probably be a buffer of a
few milliseconds. Possibly the files could be filtered to include only some of
them but that's more optional for now.
Original comment by wer...@beroux.com
on 10 Sep 2013 at 11:52
Original issue reported on code.google.com by
wer...@beroux.com
on 9 Sep 2013 at 11:51