Created
August 14, 2013 20:40
-
-
Save mutaku/6235347 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import Queue | |
>>> import os | |
>>> os.chdir("c:/users/matthew/watchdog") | |
>>> from watchdog import WatchDog | |
>>> import threading | |
>>> class WD(threading.Thread): | |
... def run(self): | |
... while True: | |
... path = pathPool.get() | |
... if path: | |
... w = WatchDog(path, 2) | |
... w.monitor() | |
... | |
>>> pathPool = Queue.Queue(0) | |
>>> dirs = ["c:/users/matthew/watchdog", "c:/users/matthew/pyimgur"] | |
>>> for x in xrange(len(dirs)): | |
... WD().start() | |
... | |
>>> for dir in dirs: | |
... pathPool.put(dir) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment