Move these Eliot events somewhere reusable

This commit is contained in:
Jean-Paul Calderone 2019-03-12 15:00:15 -04:00
parent 9ed019f8de
commit fcb08b5a3a

View File

@ -49,7 +49,8 @@ from allmydata.util.fake_inotify import humanReadableMask, \
_FLAG_TO_HUMAN
from ..util.eliotutil import (
INOTIFY_EVENTS,
MAYBE_NOTIFY,
CALLBACK,
validateInstanceOf,
)
@ -68,13 +69,6 @@ _PATH = Field.for_types(
u"The path an inotify event concerns.",
)
MAYBE_NOTIFY = ActionType(
u"watchdog:inotify:maybe-notify",
[],
[],
u"An inotify event is being considered for dispatch to an application handler.",
)
_EVENT = Field(
u"event",
lambda e: e.__class__.__name__,
@ -89,13 +83,6 @@ ANY_INOTIFY_EVENT = ActionType(
u"An inotify event is being dispatched.",
)
CALLBACK = ActionType(
u"watchdog:inotify:callback",
[INOTIFY_EVENTS],
[],
u"An inotify event is being dispatched to an application callback."
)
class INotifyEventHandler(FileSystemEventHandler):
def __init__(self, path, mask, callbacks, pending_delay):
FileSystemEventHandler.__init__(self)