From 2c1f7af5e849b6aba6279998b978368554e2204f Mon Sep 17 00:00:00 2001 From: chrys87 Date: Mon, 11 Jul 2016 15:19:35 +0200 Subject: [PATCH] Update TODO --- TODO | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index b6aba9ab..179afc92 100644 --- a/TODO +++ b/TODO @@ -8,7 +8,7 @@ ToDos in Priority order: https://github.com/seb-m/pyinotify/wiki/Tutorial import pyinotify - +import glob class Identity(pyinotify.ProcessEvent): def process_default(self, event): p = event.pathname @@ -17,13 +17,9 @@ class Identity(pyinotify.ProcessEvent): wm = pyinotify.WatchManager() notifier = pyinotify.Notifier(wm, default_proc_fun=Identity(), timeout=5) -wm.add_watch('/dev/vcsa1', pyinotify.IN_CLOSE_WRITE, auto_add=True) -wm.add_watch('/dev/vcsa2', pyinotify.IN_CLOSE_WRITE, auto_add=True) -wm.add_watch('/dev/vcsa3', pyinotify.IN_CLOSE_WRITE, auto_add=True) -wm.add_watch('/dev/vcsa4', pyinotify.IN_CLOSE_WRITE, auto_add=True) -wm.add_watch('/dev/vcsa5', pyinotify.IN_CLOSE_WRITE, auto_add=True) -wm.add_watch('/dev/vcsa6', auto_add=True) -#notifier.loop( ) +for file in list(glob.glob('/dev/vcsa[0-64]')): + wm.add_watch(file, pyinotify.IN_CLOSE_WRITE, auto_add=True) + print(file) try: while 1: