Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
 def tearDown(self):
     rawapi.sane_close(self.dev_handle)
     rawapi.sane_exit()
Exemplo n.º 4
0
 def test_open_valid(self):
     dev_handle = rawapi.sane_open(self.dev_name)
     rawapi.sane_close(dev_handle)
Exemplo n.º 5
0
 def tearDown(self):
     rawapi.sane_close(self.dev_handle)
     rawapi.sane_exit()
Exemplo n.º 6
0
 def test_open_valid(self):
     dev_handle = rawapi.sane_open(self.dev_name)
     rawapi.sane_close(dev_handle)