We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
To make user code potentially lighter-weight, I'd like to pass a function as an event handler.
Here's some equivalent code:
class FunctionEventHandler(watchdog.events.FileSystemEventHandler): def __init__(self, f): self.f = f def on_any_event(self, event): self.f(event)
Example usage:
observer.schedule( FunctionEventHandler(updates.put), path, recursive=True )
where updates.put is here the function (updates is a python queue.Queue)
updates.put
updates
queue.Queue
My feature request is to add this into the library, so I can instead call:
observer.schedule(updates.put, path, recursive=True)
and leave out the definition of FunctionEventHandler.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
To make user code potentially lighter-weight, I'd like to pass a function as an event handler.
Here's some equivalent code:
Example usage:
where
updates.put
is here the function (updates
is a pythonqueue.Queue
)My feature request is to add this into the library, so I can instead call:
and leave out the definition of FunctionEventHandler.
The text was updated successfully, but these errors were encountered: