Example #1
0
 def do_watched(self, proc):
     self.write_all()
     
     wd = self.context.wd
     output, mods = run_watch_files(proc, wd)
     
     inputs = mods.accessed
     outputs = mods.modified.union(mods.created)
     
     inputs  = [os.path.relpath(path, wd) for path in inputs]
     outputs = [os.path.relpath(path, wd) for path in outputs]
     
     for file in inputs:
         self.watch_input(file)
     for file in outputs:
         self.watch_output_external(file)
     
     return output
Example #2
0
from treewatcher import run_watch_files
from subprocess import Popen

def proc():
    proc = Popen(
        ['runghc', 'Main.hs'],
        cwd = '.'
    )
    
    proc.wait()

_, mods = run_watch_files(proc, '.')

print(mods)