9 self
._dbus
= dbus
.SystemBus()
10 self
._serv
= self
._dbus
.get_object( 'org.freedesktop.Hal', '/org/freedesktop/Hal/Manager' )
11 self
._hal
= dbus
.Interface( self
._serv
, 'org.freedesktop.Hal.Manager' )
16 def get_properties(self
):
17 self
.udi
= os
.getenv("UDI", "")
18 self
.busnum
= self
.get_property( 'usb.bus_number' )
19 self
.devnum
= self
.get_property( 'usb.linux.device_number' )
21 def get_property(self
, name
):
22 return self
.device().GetProperty(name
, dbus_interface
="org.freedesktop.Hal.Device")
25 text
= commands
.getoutput("/usr/bin/bidentify -B %i -N %i" % (self
.busnum
, self
.devnum
))
26 sys
.stderr
.write("Found '%s' at %s, %s\n" % (text
, self
.busnum
, self
.devnum
))
31 self
.set_property("sync.serial", pin
)
32 self
.set_property("info.product", desc
)
34 def set_property(self
, name
, value
):
35 return self
.device().SetPropertyString(name
, value
, dbus_interface
="org.freedesktop.Hal.Device")
39 self
._device
= self
._dbus
.get_object("org.freedesktop.Hal", self
.udi
)