From 64cbffad1e7e18b2827a08b6eb47673c425d1967 Mon Sep 17 00:00:00 2001 From: Jonathan Harris <jonathan@marginal.org.uk> Date: Mon, 30 Nov 2015 14:43:16 +0000 Subject: [PATCH] Stub out use of watchdog module on Linux. Fix for bug introduced by a94cf4c. --- README.md | 4 ++-- monitor.py | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 539ebf1f..9eeb57a9 100644 --- a/README.md +++ b/README.md @@ -90,12 +90,12 @@ Download and extract the source code of the [latest release](https://github.com/ Mac: -* Requires the Python “requests” module - install this with `easy_install requests` . +* Requires the Python “requests” and “watchdog” modules - install these with `easy_install requests watchdog` . * Run with `./EDMarketConnector.py` . Windows: -* Requires Python2.7 and the Python “requests” module. +* Requires Python2.7 and the Python “requests” and “watchdog” modules. * Run with `EDMarketConnector.py` . Linux: diff --git a/monitor.py b/monitor.py index 57622215..01d832bb 100644 --- a/monitor.py +++ b/monitor.py @@ -8,17 +8,18 @@ from sys import platform from time import strptime, localtime, mktime, sleep, time from datetime import datetime -from watchdog.observers import Observer -from watchdog.events import FileSystemEventHandler - if __debug__: from traceback import print_exc if platform=='darwin': from AppKit import NSWorkspace from Foundation import NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSUserDomainMask + from watchdog.observers import Observer + from watchdog.events import FileSystemEventHandler elif platform=='win32': + from watchdog.observers import Observer + from watchdog.events import FileSystemEventHandler import ctypes CSIDL_LOCAL_APPDATA = 0x001C @@ -63,6 +64,9 @@ elif platform=='win32': return False # stop enumeration return True +else: + FileSystemEventHandler = object # dummy + class EDLogs(FileSystemEventHandler):