Beispiel #1
0
def get_devices():
    '''Return SANE devices, perhaps after creating a test device.'''
    devices = rawapi.sane_get_devices()
    if len(devices) == 0:
        # if there are no devices found, create a virtual device.
        # see sane-test(5) and /etc/sane.d/test.conf
        rawapi.sane_close(rawapi.sane_open("test"))
        devices = rawapi.sane_get_devices()
    return devices
Beispiel #2
0
def get_devices():
    '''Return SANE devices, perhaps after creating a test device.'''
    devices = rawapi.sane_get_devices()
    if len(devices) == 0:
        # if there are no devices found, create a virtual device.
        # see sane-test(5) and /etc/sane.d/test.conf
        rawapi.sane_close(rawapi.sane_open("test"))
        devices = rawapi.sane_get_devices()
    return devices
Beispiel #3
0
 def tearDown(self):
     rawapi.sane_close(self.dev_handle)
     rawapi.sane_exit()
Beispiel #4
0
 def test_open_valid(self):
     dev_handle = rawapi.sane_open(self.dev_name)
     rawapi.sane_close(dev_handle)
Beispiel #5
0
 def tearDown(self):
     rawapi.sane_close(self.dev_handle)
     rawapi.sane_exit()
Beispiel #6
0
 def test_open_valid(self):
     dev_handle = rawapi.sane_open(self.dev_name)
     rawapi.sane_close(dev_handle)