def on_bListScanDevices_clicked(self, event): liDevs = sane.get_devices() print 'Available devices=', liDevs cb = self.getWidget('cbScanDevice') for devs in liDevs: listItem_a = gtk.ListItem(devs[0]) cb.list.append_items([listItem_a])
def __get_sane_signature(self): d = self.__dict__ if 'sane_signature' not in d: devices = _sane.get_devices() if devices: for dev in devices: if d['devname'] == dev[0]: d['sane_signature'] = dev break if 'sane_signature' not in d: raise RuntimeError("No such scan device '%s'" % d['devname']) return d['sane_signature']
def get_devices(localOnly=False): """ Return a list of 4-tuples containing the available scanning devices. If `localOnly` is `True`, only local devices will be returned. Each tuple is of the format ``(device_name, vendor, model, type)``, with: * `device_name` -- The device name, suitable for passing to :func:`sane.open`. * `vendor` -- The device vendor. * `model` -- The device model vendor. * `type` -- the device type, such as ``"virtual device"`` or ``"video camera"``. :returns: A list of scanning devices. :raises _sane.error: If an error occurs. """ return _sane.get_devices(localOnly)
def get_devices(): initialize() return sane.get_devices()