mirror of https://github.com/NaN-tic/nanscan.git
More uppercase renaming.
This commit is contained in:
parent
c00ce1cabe
commit
021d5df12d
|
@ -21,7 +21,7 @@ from PyQt4.QtGui import *
|
|||
import sane
|
||||
# PIL Module to convert PIL Image Object to QImage
|
||||
import ImageQt
|
||||
import common
|
||||
import Common
|
||||
|
||||
class SynchronousScanner(QObject):
|
||||
|
||||
|
@ -50,7 +50,7 @@ class SynchronousScanner(QObject):
|
|||
if not name:
|
||||
devices = self.listDevices()
|
||||
if not devices:
|
||||
self.emit( SIGNAL('error(int)'), common.ScannerError.NoDeviceFound )
|
||||
self.emit( SIGNAL('error(int)'), Common.ScannerError.NoDeviceFound )
|
||||
return
|
||||
name = devices[0]
|
||||
|
||||
|
@ -60,7 +60,7 @@ class SynchronousScanner(QObject):
|
|||
print "opened ", name
|
||||
except:
|
||||
print "error", name
|
||||
self.emit( SIGNAL('error(int)'), common.ScannerError.CouldNotOpenDevice )
|
||||
self.emit( SIGNAL('error(int)'), Common.ScannerError.CouldNotOpenDevice )
|
||||
return
|
||||
|
||||
source.mode = 'color'
|
||||
|
@ -84,11 +84,11 @@ class SynchronousScanner(QObject):
|
|||
# the scanner
|
||||
pass
|
||||
except:
|
||||
self.emit( SIGNAL('error(int)'), common.ScannerError.AcquisitionError )
|
||||
self.emit( SIGNAL('error(int)'), Common.ScannerError.AcquisitionError )
|
||||
|
||||
# Member of SynchronousScanner Interface
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
|
||||
common.ScannerBackend = SynchronousScanner
|
||||
Common.ScannerBackend = SynchronousScanner
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import twain, struct, string
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
#from common import *
|
||||
import common
|
||||
import Common
|
||||
|
||||
class SynchronousScanner(QObject):
|
||||
|
||||
|
@ -60,15 +59,15 @@ class SynchronousScanner(QObject):
|
|||
l = self.listDevices()
|
||||
if not l:
|
||||
print "No device found"
|
||||
return common.ScannerError.NoDeviceFound
|
||||
return Common.ScannerError.NoDeviceFound
|
||||
name = l[0]
|
||||
|
||||
try:
|
||||
self.open(name)
|
||||
except:
|
||||
return common.ScannerError.CouldNotOpenDevice
|
||||
return Common.ScannerError.CouldNotOpenDevice
|
||||
if not self.source:
|
||||
return common.ScannerError.CouldNotOpenDevice
|
||||
return Common.ScannerError.CouldNotOpenDevice
|
||||
|
||||
try:
|
||||
self.source.SetCapability( twain.ICAP_YRESOLUTION, twain.TWTY_FIX32, float(self.resolution) )
|
||||
|
@ -85,12 +84,12 @@ class SynchronousScanner(QObject):
|
|||
try:
|
||||
self.source.RequestAcquire(0, 0)
|
||||
except:
|
||||
return common.ScannerError.AcquisitionError
|
||||
return Common.ScannerError.AcquisitionError
|
||||
|
||||
while self.next():
|
||||
image = self.capture()
|
||||
if not image:
|
||||
return common.ScannerError.AcquisitionError
|
||||
return Common.ScannerError.AcquisitionError
|
||||
self.emit( SIGNAL('scanned(QImage)'), image )
|
||||
self.source = None
|
||||
|
||||
|
@ -119,4 +118,4 @@ class SynchronousScanner(QObject):
|
|||
def close(self):
|
||||
del self.manager
|
||||
|
||||
common.ScannerBackend = SynchronousScanner
|
||||
Common.ScannerBackend = SynchronousScanner
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
# Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
import os
|
||||
from backends.common import *
|
||||
from Backends.Common import *
|
||||
|
||||
if os.name == 'nt':
|
||||
from backends.twain_backend import *
|
||||
from Backends.TwainBackend import *
|
||||
else:
|
||||
from backends.sane_backend import *
|
||||
from Backends.SaneBackend import *
|
||||
|
||||
|
|
Loading…
Reference in New Issue