Listing HAL devices

mukesh tiwari mukeshtiwari.iiitm at
Thu Sep 1 17:46:50 CEST 2011

Hello all
I am trying to write a python script which detects usb pen drive and
copy all the data into my home directory. After bit of searching , i
found these two links 1]
and 2]
. I just copied the wiki program but after running it , i got error

import dbus

class BusListener:
        def __init__( self ):
                self.bus = dbus.SystemBus()
                self.hal_obj =
self.bus.get_object('org.freedesktop.Hal' , '/org/freedesktop/Hal/
Manager' )
                print self.proxy

if __name__ == "__main__":
        obj = BusListener()

Traceback (most recent call last):
  File "", line 13, in <module>
    obj = BusListener()
  File "", line 7, in __init__
    self.hal_obj = self.bus.get_object('org.freedesktop.Hal' , '/org/
freedesktop/Hal/Manager' )
  File "/usr/lib/pymodules/python2.7/dbus/", line 244, in
  File "/usr/lib/pymodules/python2.7/dbus/", line 241, in
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/pymodules/python2.7/dbus/", line 183, in
  File "/usr/lib/pymodules/python2.7/dbus/", line 281, in
    'su', (bus_name, flags)))
  File "/usr/lib/pymodules/python2.7/dbus/", line 630, in
    message, timeout)
org.freedesktop.DBus.Error.ServiceUnknown: The name
org.freedesktop.Hal was not provided by any .service files

Kindly some one please tell me why i am getting this error .
Thank you

More information about the Python-list mailing list