Writing a HAL/DBUS Python program

David Eriksson twogood at users.sourceforge.net
Wed Jan 12 04:25:54 PST 2005


On Wed, 2005-01-12 at 04:13 -0800, Jono Bacon wrote:
> Hi all,
> 
> I am fairly new to Python and I have recently got my
> head around writing GNOME applications with Glade.
> Anyway, I am interested in writing a program to detect
> when a USB stick is plugged in, and to then copy a
> file to the USB stick. This obviously needs some
> HAL/DBUS sprinking into my Python program.
> 
> I have hunted around the interweb for documentation
> about this and found relatively little. I am not sure
> where I need to start. Can any of you help with these
> questions:
> 
>  - Firstly, in terms of detecting if the device has
> been plugged in, is this a HAL or DBUS thing?
> 
>  - What kind of code would I need to write to detect
> if a USB device has been plugged in?
> 
> I am more than happy to write some tutorials on how to
> do this if you chaps can help me out with getting
> started.

I suggest that you look at the script code for hal-device-manager. It's
Python, HAL, D-BUS, GNOME and Glade, all you could wish for! :-)

See the files in tools/device-manager/ in the "hal" CVS module or source
code packaage.

-- 
Regards,
               -\- David Eriksson -/-

        SynCE - http://synce.sourceforge.net
      ScummVM - http://scummvm.sourceforge.net
     Desquirr - http://desquirr.sourceforge.net

_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list