From: Albert Hopkins on 1 Mar 2010 07:09 On Mon, 2010-03-01 at 10:48 +0100, Bart Smeets wrote: > Hello, > > > I'm trying to write a script which detects when a new removable drive > is connected to the computer. On #python I was advised to use the > dbus-bindings. However the documentation on this is limited. Does > anyone know of an example of how I can detect new removable drives? The documentation does suck and, at least for the python bindings, is horribly outdated. Also, the python bindings for dbus are not as "pythonic" as they could be. I was working on a python/dbus program a while back and basically had to resort to looking at the source of a program that did, or almost did, what I wanted and using that as an example. You may even want to look at C sources as I don't think the python bindings are that much different. HTH, -a
From: Stefan Behnel on 1 Mar 2010 07:46 Bart Smeets, 01.03.2010 10:48: > I'm trying to write a script which detects when a new removable drive is > connected to the computer. On #python I was advised to use the > dbus-bindings. However the documentation on this is limited. Does anyone > know of an example of how I can detect new removable drives? You could execute a script from HAL, e.g. using halevt, and let the script communicate with your program. http://www.nongnu.org/halevt/ Stefan
|
Pages: 1 Prev: Draft PEP on RSON configuration file format Next: Class attributes / methods lost? |