mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-23 06:01:56 +00:00
Rename watchdog's EventHandlers to avoid confusion
This commit is contained in:
parent
c8dca5f33b
commit
6e391b6b2c
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user