On Dec 19, 2008, at 11:38 AM, David Ripton wrote:
To try inotify.py, I Twistified my code (easy because it was already
event-driven PyGTK), then changed all the inotify calls to use the
sandbox module's API rather than mine. The only thing I disliked about
the API was having to pass the callbacks are to the watch method, rather
than the watch method returning a Deferred that I could addCallback on,
but that's just different, not actually hard or confusing.
That pisses me off too... The problem with the API you suggest is that it's
a one shot API and you should keep adding those callbacks and call
watch which is not doable here... I'm open to suggestions to change it even
with a custom Protocol class (Which probably would fit better in Twisted
maybe but that's more cumbersome than adding the callbacks IMHO).
Anyway, it works and my code is a bit smaller and cleaner than it was
before and uses a tad less CPU. I hope this ends up in a Twisted
release. I see #972 in the tracker, but it's been untouched for a
long time. Should I comment there?
setup a twisted branch with ampoule inside.