def watch(self): '''Watch sphinx_path signalling render when rst files change ''' with fs_event_ctx(self.c.sphinx_path, self.c.extensions) as fs_ev_iter: for event in fs_ev_iter: log.debug('filesystem event: {}'.format(event, event.ev_name)) self.watch_ev.set()
def watch(self): '''Watch sphinx_path signalling render when rst files change ''' with fs_event_ctx(self.c.sphinx_path, self.c.extensions) as fs_ev_iter: for event in fs_ev_iter: logger.info('%s %s', event, event.ev_name) self.watch_ev.set()
def test_fs_event_ctx(): with tempdir() as tmpdir, fs_event_ctx(tmpdir, ['rst']) as fs_event: filename = tmpdir + '/test.rst' open(filename, 'w') assert filename == next(fs_event) filename = tmpdir + '/test2.rst' open(filename, 'w') assert filename == next(fs_event)