mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 07:06:41 +00:00
Move these Eliot events somewhere reusable
This commit is contained in:
parent
9ed019f8de
commit
fcb08b5a3a
@ -49,7 +49,8 @@ from allmydata.util.fake_inotify import humanReadableMask, \
|
|||||||
_FLAG_TO_HUMAN
|
_FLAG_TO_HUMAN
|
||||||
|
|
||||||
from ..util.eliotutil import (
|
from ..util.eliotutil import (
|
||||||
INOTIFY_EVENTS,
|
MAYBE_NOTIFY,
|
||||||
|
CALLBACK,
|
||||||
validateInstanceOf,
|
validateInstanceOf,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -68,13 +69,6 @@ _PATH = Field.for_types(
|
|||||||
u"The path an inotify event concerns.",
|
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(
|
_EVENT = Field(
|
||||||
u"event",
|
u"event",
|
||||||
lambda e: e.__class__.__name__,
|
lambda e: e.__class__.__name__,
|
||||||
@ -89,13 +83,6 @@ ANY_INOTIFY_EVENT = ActionType(
|
|||||||
u"An inotify event is being dispatched.",
|
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):
|
class INotifyEventHandler(FileSystemEventHandler):
|
||||||
def __init__(self, path, mask, callbacks, pending_delay):
|
def __init__(self, path, mask, callbacks, pending_delay):
|
||||||
FileSystemEventHandler.__init__(self)
|
FileSystemEventHandler.__init__(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user