[projects/git-slug: 85/170] Move watch manager and watched events variables into run
glen
glen at pld-linux.org
Mon Sep 21 21:45:57 CEST 2015
commit f39a27432f1bd152b292d8224f5d5538d055eb9c
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Mon Mar 12 11:11:33 2012 +0000
Move watch manager and watched events variables into run
slug_watch | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/slug_watch b/slug_watch
index ffbec8e..5c0a298 100755
--- a/slug_watch
+++ b/slug_watch
@@ -21,9 +21,6 @@ REFREPO_GDIR = os.path.join('repositories', REFREPO+'.git')
WATCHDIR=WATCHDIR
-wm = pyinotify.WatchManager() # Watch Manager
-mask = pyinotify.IN_CLOSE_WRITE # watched events
-
@contextmanager
def lock(path=LOCKFILE):
f = open(path, 'a')
@@ -83,6 +80,8 @@ def run():
if not os.path.isdir(directory):
print('Creating {}'.format(directory))
os.mkdir(directory)
+ wm = pyinotify.WatchManager() # Watch Manager
+ mask = pyinotify.IN_CLOSE_WRITE # watched events
notifier = pyinotify.Notifier(wm, EventHandler())
wdd = wm.add_watch(WATCHDIR, mask, rec=False)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5
More information about the pld-cvs-commit
mailing list