[BRLTTY] Pure python file descriptor watcher code for BrlAPI?

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Feb 24 08:02:19 EST 2008


Mario Lang, le Sun 24 Feb 2008 09:45:21 +0100, a écrit :
> Orca uses glib to add a callback for when some data arrives
> at the BrlAPI file descriptor.  This is very useful to implement
> a callback driven system for receiving brlapi keypresses.
> Does anyone have code for doing this in pure python, without a dependency
> on glib?

The problem is: when should callbacks be called?

In an event-driven glib application, it's easy: it's during the main
loop.

In a general python application, which is not necessarily event-driven,
when would that be?  The problem here is about concurrency with what
your application is currently doing, and is just the same as if you were
just starting a thread that keeps calling brlapi.readKey(), which then
runs concurrently with the main thread.

Samuel


More information about the BRLTTY mailing list