示例#1
0
 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])
示例#2
0
 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']
示例#3
0
 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']
示例#4
0
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)
示例#5
0
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)
示例#6
0
def get_devices():
    initialize()
    return sane.get_devices()