Rename watchdog's EventHandlers to avoid confusion

This commit is contained in:
Kristóf Tóth 2018-03-20 14:35:21 +01:00
parent c8dca5f33b
commit 6e391b6b2c

View File

@ -1,5 +1,5 @@
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from watchdog.events import FileSystemEventHandler as FileSystemWatchdogEventHandler
from tfw.networking.event_handlers.server_connector import ServerUplinkConnector
from tfw.components.decorators import RateLimiter
@ -11,7 +11,7 @@ log = logging.getLogger(__name__)
class DirectoryMonitor:
def __init__(self, directory):
self.observer = Observer()
self.eventhandler = WebideReloadEventHandler()
self.eventhandler = WebideReloadWatchdogEventHandler()
self.observer.schedule(self.eventhandler, directory, recursive=True)
self.pause, self.resume = self.eventhandler.pause, self.eventhandler.resume
@ -43,7 +43,7 @@ class DirectoryMonitor:
self.directorymonitor.resume()
class WebideReloadEventHandler(FileSystemEventHandler):
class WebideReloadWatchdogEventHandler(FileSystemWatchdogEventHandler):
def __init__(self):
super().__init__()
self.uplink = ServerUplinkConnector()