Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use InotifyObserver if the pyinotify dependency is satisfied.

Signed-off-by: Gora Khargosh <gora.khargosh@gmail.com>
  • Loading branch information...
commit f9a22a0db46a84508cd7a6e5294612eb0484805a 1 parent 3c5dadd
Yesudeep Mangalapilly authored November 17, 2010

Showing 1 changed file with 14 additions and 10 deletions. Show diff stats Hide diff stats

  1. 24  watchdog/__init__.py
24  watchdog/__init__.py
@@ -7,16 +7,20 @@
7 7
 from events import FileSystemEventHandler
8 8
 
9 9
 try:
10  
-    import _watchdog_fsevents
11  
-    logging.debug('Using FSEventsObserver.')
12  
-    from fsevents_observer import FSEventsObserver as Observer
  10
+    import pyinotify
  11
+    logging.debug('Using InotifyObserver')
  12
+    from inotify_observer import InotifyObserver as Observer
13 13
 except ImportError:
14 14
     try:
15  
-        import win32file
16  
-        import win32con
17  
-        logging.debug('Using Win32Observer.')
18  
-        from win32_observer import Win32Observer as Observer
  15
+        import _watchdog_fsevents
  16
+        logging.debug('Using FSEventsObserver.')
  17
+        from fsevents_observer import FSEventsObserver as Observer
19 18
     except ImportError:
20  
-        logging.debug('Using PollingObserver as fallback.')
21  
-        from polling_observer import PollingObserver as Observer
22  
-
  19
+        try:
  20
+            import win32file
  21
+            import win32con
  22
+            logging.debug('Using Win32Observer.')
  23
+            from win32_observer import Win32Observer as Observer
  24
+        except ImportError:
  25
+            logging.debug('Using PollingObserver as fallback.')
  26
+            from polling_observer import PollingObserver as Observer

0 notes on commit f9a22a0

Please sign in to comment.
Something went wrong with that request. Please try again.